[clang] [Clang][Parse] Diagnose member template declarations with multiple declarators (PR #78243)
Krystian Stasiowski via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 16 09:23:18 PST 2024
================
@@ -3167,6 +3167,15 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
DeclaratorInfo.complete(ThisDecl);
+ if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) {
+ if (Tok.is(tok::comma)) {
+ Diag(Tok, diag::err_multiple_template_declarators)
+ << (int)TemplateInfo.Kind;
+ SkipUntil(tok::semi, StopBeforeMatch);
+ }
+ break;
+ }
----------------
sdkrystian wrote:
How about issuing the diagnostics in the parser, but instead of skipping to the semicolon we just continue parsing? That way the diagnostics are issued in lexical order when a declaration with multiple errors is encountered.
https://github.com/llvm/llvm-project/pull/78243
More information about the cfe-commits
mailing list