================
@@ -3139,6 +3139,19 @@ Parser::DeclGroupPtrTy 
Parser::ParseCXXClassMemberDeclaration(
     return Actions.BuildDeclaratorGroup(Decls);
   }
 
+  // Befriending a concept is invalid and would already fail if
+  // we did nothing here, but this allows us to issue a more
+  // helpful diagnostic.
+  if (Tok.is(tok::kw_concept)) {
----------------
Sirraide wrote:

> Could we get a standard reference for a befriending a concept being invalid.

Pretty sure the syntax just doesn’t allow for it: Neither a 
`simple-type-specifier`, nor an `elaborated-type-specifier`, nor a 
`typename-specifier` can start with `concept`. The grammatical productions for 
`friend-type-specifier` are already listed in the comment at the top of the 
function.

https://github.com/llvm/llvm-project/pull/105121
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to