diff options
author | John McCall <rjmccall@apple.com> | 2013-03-22 02:10:40 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-03-22 02:10:40 +0000 |
commit | eaef89b197e640785a1fdb167725359248f77720 (patch) | |
tree | c6dd6faaae9e949ce59ae43d60c4a13c824540f5 /clang/lib/Sema/SemaDecl.cpp | |
parent | ce9a1341f2146d75767f950bbb23dd866690be38 (diff) | |
download | bcm5719-llvm-eaef89b197e640785a1fdb167725359248f77720.tar.gz bcm5719-llvm-eaef89b197e640785a1fdb167725359248f77720.zip |
Fix a crash-on-valid where a block capture copy expression was
picking up cleanups from earlier in the statement. Also fix a
crash-on-invalid where a reference to an invalid decl from an
enclosing scope was causing an expression to fail to build, but
only *after* a cleanup was registered from that statement,
causing an assertion downstream.
The crash-on-valid is rdar://13459289.
llvm-svn: 177692
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8213739b4e3..5597bf60097 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -7916,6 +7916,7 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { // Regardless, we don't want to ignore array nesting when // constructing this copy. if (type->isStructureOrClassType()) { + EnterExpressionEvaluationContext scope(*this, PotentiallyEvaluated); SourceLocation poi = var->getLocation(); Expr *varRef =new (Context) DeclRefExpr(var, false, type, VK_LValue, poi); ExprResult result |