summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index c1ce02eeea2..b989fac8389 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -8892,6 +8892,8 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
Diag(CaretLoc, diag::err_blocks_disable);
// Leave the expression-evaluation context.
+ if (hasAnyUnrecoverableErrorsInThisFunction())
+ DiscardCleanupsInEvaluationContext();
assert(!ExprNeedsCleanups && "cleanups within block not correctly bound!");
PopExpressionEvaluationContext();
OpenPOWER on IntegriCloud