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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 08:51:54 PDT 2026


================
@@ -1880,16 +1880,76 @@ Sema::ConditionResult Parser::ParseCXXCondition(StmtResult *InitStmt,
     return Sema::ConditionError();
   }
 
+  if (Tok.is(tok::kw___extension__)) {
+    // In C, the first clause of a condition may be a declaration used as an
----------------
AaronBallman wrote:

```suggestion
    // The first clause of a condition may be a declaration used as an
```
Just so it doesn't look like this is supposed to be C-specific.

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


More information about the cfe-commits mailing list