summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-02 13:00:07 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-02 13:00:07 +0000
commitc63de66c4f50973b54e3341194bf847e7bfefe1f (patch)
treedb578fef9737ff5f7d251069278373980f94fe22 /clang/lib/Sema/SemaChecking.cpp
parentfdfdbd091d663b1b3c12cf96064d755887b8aaa7 (diff)
downloadbcm5719-llvm-c63de66c4f50973b54e3341194bf847e7bfefe1f.tar.gz
bcm5719-llvm-c63de66c4f50973b54e3341194bf847e7bfefe1f.zip
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
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp2
1 files changed, 1 insertions, 1 deletions
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<DeclRefExpr *> &refVars) {
}
case Stmt::BlockExprClass:
- if (cast<BlockExpr>(E)->hasBlockDeclRefExprs())
+ if (cast<BlockExpr>(E)->getBlockDecl()->hasCaptures())
return E; // local block.
return NULL;
OpenPOWER on IntegriCloud