Skip to content

Commit fdddae5

Browse files
fixup! Try to fix #83028
ActOnForStmt() requires a CompoundScope when processing a NullStmt body
1 parent 5232617 commit fdddae5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20449,13 +20449,15 @@ Decl *Sema::ActOnFileScopeAsmDecl(Expr *expr,
2044920449
TopLevelStmtDecl *Sema::ActOnStartTopLevelStmtDecl(Scope *S) {
2045020450
auto *New = TopLevelStmtDecl::Create(Context, /*Statement=*/nullptr);
2045120451
PushFunctionScope();
20452+
PushCompoundScope(false);
2045220453
PushDeclContext(S, New);
2045320454
return New;
2045420455
}
2045520456

2045620457
void Sema::ActOnFinishTopLevelStmtDecl(TopLevelStmtDecl *D, Stmt *Statement) {
2045720458
D->setStmt(Statement);
2045820459
PopDeclContext();
20460+
PopCompoundScope();
2045920461
PopFunctionScopeInfo();
2046020462
}
2046120463

0 commit comments

Comments
 (0)