[clang] [Clang][C2y] Add support for if declarations (N3356 paper) (PR #198244)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 12 06:58:51 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:

Hrm, it seems like we may be working around a deeper bug then, I think more investigation is needed here.

https://github.com/llvm/llvm-project/pull/198244


More information about the cfe-commits mailing list