Skip to content

Commit 83265cf

Browse files
fixup! Try to fix #83028
ActOnForStmt() requires a CompoundScope when processing a NullStmt body
1 parent 5aa374d commit 83265cf

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
@@ -20522,13 +20522,15 @@ Decl *Sema::ActOnFileScopeAsmDecl(Expr *expr,
2052220522
TopLevelStmtDecl *Sema::ActOnStartTopLevelStmtDecl(Scope *S) {
2052320523
auto *New = TopLevelStmtDecl::Create(Context, /*Statement=*/nullptr);
2052420524
PushFunctionScope();
20525+
PushCompoundScope(false);
2052520526
PushDeclContext(S, New);
2052620527
return New;
2052720528
}
2052820529

2052920530
void Sema::ActOnFinishTopLevelStmtDecl(TopLevelStmtDecl *D, Stmt *Statement) {
2053020531
D->setStmt(Statement);
2053120532
PopDeclContext();
20533+
PopCompoundScope();
2053220534
PopFunctionScopeInfo();
2053320535
}
2053420536

0 commit comments

Comments
 (0)