aaron.ballman added inline comments.
================ Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:552-553 "extraneous ')' after condition, expected a statement">; +def ext_alias_in_init_statement : ExtWarn< + "alias declaration in this context is a C++2b extension">, + InGroup<CXX2b>; ---------------- Can you also add the "incompatible with standards before C++2b" variant of this diagnostic? ================ Comment at: clang/lib/Parse/ParseDeclCXX.cpp:720-722 + if (InInitStatement && Tok.isNot(tok::identifier)) { + return nullptr; + } ---------------- ================ Comment at: clang/lib/Parse/ParseExprCXX.cpp:1927-1930 + if (!getLangOpts().CPlusPlus2b) { + Diag(DeclStart, diag::ext_alias_in_init_statement) + << SourceRange(DeclStart, DeclEnd); + } ---------------- Though I suspect this will change somewhat when you add the precompat warning. ================ Comment at: clang/lib/Parse/ParseExprCXX.cpp:2047-2050 + else { + DG = ParseSimpleDeclaration(DeclaratorContext::SelectionInit, DeclEnd, + attrs, /*RequireSemi=*/true); + } ---------------- ================ Comment at: clang/lib/Parse/ParseTentative.cpp:486-488 + if (CanBeInitStatement && Tok.is(tok::kw_using)) { + return ConditionOrInitStatement::InitStmtDecl; + } else if (State.update(isCXXDeclarationSpecifier())) ---------------- No `else` after a `return`, and can drop the curly braces, per coding standard. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111175/new/ https://reviews.llvm.org/D111175 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits