-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
"error: identifier 'line' after '~' in destructor name does not name a type" in struct line
that has line
member
#88597
Comments
@llvm/issue-subscribers-clang-frontend Author: наб (nabijaczleweli)
```cpp
#include <string_view>
struct line {
cmd/join.cpp:49:5: error: identifier 'line' after '~' in destructor name does not name a type
|
Reduced: https://godbolt.org/z/EeGn5vTrY struct line {
int line;
~line();
}; It looks like rule here is set by cwg80:
So this applies to constructors but not destructors. We handle this here: llvm-project/clang/lib/Sema/SemaExprCXX.cpp Lines 451 to 453 in aef2810
I think we need to handle the case where |
In this case it looks like this is |
trunk returns
older versions return
All GCC versions accept this.
Don't particularly see why the member would factor into the lookup at all here, but it's not like I can call this
~(struct line)() {
or~struct line() {
.The text was updated successfully, but these errors were encountered: