Skip to content

Commit 5d5776b

Browse files
author
David Ungar
committed
Tolerate non-empty braces in braces
1 parent 3ef8360 commit 5d5776b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/AST/ASTScopeCreation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,10 @@ class ScopeCreator final {
658658
ASTScopeAssert(!n.isDecl(DeclKind::Accessor),
659659
"Should not see accessors here");
660660
// Can occur in illegal code
661+
// non-empty brace stmt could define a new insertion point
661662
if (auto *const s = n.dyn_cast<Stmt *>()) {
662663
if (auto *const bs = dyn_cast<BraceStmt>(s))
663-
ASTScopeAssert(bs->empty(), "Might mess up insertion point");
664+
return !bs->empty();
664665
}
665666
return !n.isDecl(DeclKind::Var);
666667
}

0 commit comments

Comments
 (0)