From c63de66c4f50973b54e3341194bf847e7bfefe1f Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 2 Feb 2011 13:00:07 +0000 Subject: An insomniac stab at making block declarations list the variables they close on, as well as more reliably limiting invalid references to locals from nested scopes. llvm-svn: 124721 --- clang/lib/Sema/SemaChecking.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaChecking.cpp') diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 0ca1ce52ab1..24ce72032ce 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -1935,7 +1935,7 @@ static Expr *EvalAddr(Expr *E, llvm::SmallVectorImpl &refVars) { } case Stmt::BlockExprClass: - if (cast(E)->hasBlockDeclRefExprs()) + if (cast(E)->getBlockDecl()->hasCaptures()) return E; // local block. return NULL; -- cgit v1.2.3