- Notifications
You must be signed in to change notification settings - Fork 15.3k
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
With this code:
int main() { struct A { void foo(auto x) {} // auto not permitted }; } And clang-18,19,20 or trunk and -std=c++20 or -std=c++23:
error: templates cannot be declared inside of a local class
No line number, no filename and refer to template.
With -std=c++17:
test.cpp:5:14: error: 'auto' not allowed in function prototype 5 | void foo(auto x) {} | ^~~~ With gcc (same message for C++17 or C++20):
test.cpp: In function ‘int main()’: test.cpp:5:14: error: ‘auto’ parameter not permitted in this context 5 | void foo(auto x) {} | ^~~~ localspook
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute