Adding diagnostic for concepts declared as non template (function or variable)
Details
Details
Diff Detail
Diff Detail
Event Timeline
include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
1970 | Using just "concept" here to refer to the specifier is a bit confusing. Perhaps: |
Comment Actions
modifying diagnostic message to: 'concept' can only appear on the definition of a function template or variable template
Comment Actions
In test/Parser/cxx-concept-declaration.cpp:
concept D1 = true; // expected-error {{C++ requires a type specifier for all declarations}}
triggers the new error and fails the test.
Comment Actions
Thanks Richard.
Sorry about the failed test that Hubert brought up. I'll remove that if no
one objects since it's covered by the Sema tests in this Patch.
Potentially that test in the Parser could be modified to be:
template<typename T>
concept D1 = true;
However, it will just pass and I believe it needs a diagnostic for the
return type not being bool.
Using just "concept" here to refer to the specifier is a bit confusing. Perhaps:
"the concept specifier may only be applied to the definition of a function or variable template"