-
Notifications
You must be signed in to change notification settings - Fork 12.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang trunk does not compile overloaded member functions with ref-qualifier #76358
Comments
@llvm/issue-subscribers-clang-frontend Author: forworldm (forworldm)
```c++
struct C {
template<int> void f() && {}
template<typename T> void f() const {}
};
```
```
<source>:3:31: error: cannot overload a member function without a ref-qualifier with a member function with ref-qualifier '&&'
3 | template<typename T> void f() const {}
| ^
<source>:2:24: note: previous declaration is here
2 | template<int> void f() && {}
| ^
1 error generated.
Compiler returned: 1
```
|
This regressed as a side effect of I think it should still accept the construction used here? It always worked in the past, and appears to break even compilation of older llvm versions! |
Specifically, it seems to be caused by the moving of the block in // If the function is a class member, its signature includes the
// cv-qualifiers (if any) and ref-qualifier (if any) on the function itself. and emits |
We should probably check the template parameter list before the check of signature as two functions with different template head are not overloads |
How problematic is it to temporarily revert af47517, until this problem can be fixed? I'm encountering the |
Pretty problematic and disruptive given the fix should be easy... I'll get on it... |
Functions which correspond but have different template parameter lists are not redeclarations. Fixes a regression introduced by af4751 (The patch just moves the template parameters check above if the signature check) Fixes llvm#76358
Functions which correspond but have different template parameter lists are not redeclarations. Fixes a regression introduced by af4751 (The patch just moves the template parameters check above if the signature check) Fixes #76358
Thanks, that seems to work fine! |
Functions which correspond but have different template parameter lists are not redeclarations. Fixes a regression introduced by af4751 (The patch just moves the template parameters check above if the signature check) Fixes llvm#76358
see https://godbolt.org/z/Kv83s6oY3
The text was updated successfully, but these errors were encountered: