diff options
Diffstat (limited to 'Parse/Parser.cpp')
-rw-r--r-- | Parse/Parser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp index 26835825d8..117afab5cf 100644 --- a/Parse/Parser.cpp +++ b/Parse/Parser.cpp @@ -189,8 +189,10 @@ void Parser::EnterScope(unsigned ScopeFlags) { void Parser::ExitScope() { assert(CurScope && "Scope imbalance!"); - // Inform the actions module that this scope is going away. - Actions.PopScope(Tok.getLocation(), CurScope); + // Inform the actions module that this scope is going away if there are any + // decls in it. + if (!CurScope->decl_empty()) + Actions.PopScope(Tok.getLocation(), CurScope); Scope *OldScope = CurScope; CurScope = OldScope->getParent(); |