[clang] [clang][Parser] Warn when the body of expansion statement is not a compound statement (PR #209229)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 14 22:55:16 PDT 2026
================
@@ -2379,6 +2383,9 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc,
return StmtError();
}
+ if (!isa<CompoundStmt>(Body.get()) || BodyStartsWithSquare)
+ Diag(BodyBeginLoc, diag::ext_expansion_stmt_missing_braces);
+
----------------
cor3ntin wrote:
good point
https://github.com/llvm/llvm-project/pull/209229
More information about the cfe-commits
mailing list