[clang] [Clang][C2y] Add support for if declarations (N3356 paper) (PR #198244)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 11 05:24:14 PDT 2026
================
@@ -1970,6 +2024,13 @@ Sema::ConditionResult Parser::ParseCXXCondition(StmtResult *InitStmt,
DeclSpec DS(AttrFactory);
ParseSpecifierQualifierList(DS, AS_none, DeclSpecContext::DSC_condition);
+ // The Declarator's DeclarationAttrs only accepts [[]] and keyword attributes;
+ // move any GNU attributes onto the DeclSpec instead.
+ if (!getLangOpts().CPlusPlus)
----------------
AaronBallman wrote:
This seems pretty suspicious to me, can you explain why it's needed a bit more? CC @erichkeane
https://github.com/llvm/llvm-project/pull/198244
More information about the cfe-commits
mailing list