[clang] [Clang][Parser] Remove the concept from the DeclContext if the definition is invalid (PR #111179)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 4 09:01:08 PDT 2024


================
@@ -1151,3 +1151,17 @@ int test() {
 }
 
 }
+
+namespace GH109780 {
+
+template <typename T>
+concept Concept; // expected-error {{expected '='}}
+
+bool val = Concept<int>; // expected-error {{use of undeclared identifier 'Concept'}}
----------------
zyn0217 wrote:

It could be improved as to the confusing language 'undeclared identifier'.

We probably could continue as if the concept was defined as `= false`, but I'm not sure there's much value in it.

https://github.com/llvm/llvm-project/pull/111179


More information about the cfe-commits mailing list