================
@@ -6327,12 +6331,42 @@ bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec
&SS, DeclContext *DC,
return false;
}
+ // C++23 [temp.names]p5:
+ // The keyword template shall not appear immediately after a declarative
+ // nested-name-specifier.
+ if (TemplateId && TemplateId->TemplateKWLoc.isValid()) {
+ Diag(Loc, diag::ext_template_after_declarative_nns)
+ << FixItHint::CreateRemoval(TemplateId->TemplateKWLoc);
+ }
+
+ NestedNameSpecifierLoc SpecLoc(SS.getScopeRep(), SS.location_data());
+ while (SpecLoc.getPrefix()) {
+ // C++23 [temp.names]p5:
+ // The keyword template shall not appear immediately after a declarative
+ // nested-name-specifier.
+ // FIXME: nested-name-specifiers in friend declarations are declarative,
+ // but we don't call diagnoseQualifiedDeclaration for them. We should.
----------------
cor3ntin wrote:
Can you add a test for that?
https://github.com/llvm/llvm-project/pull/78595
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits