aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-04-17 00:09:41 +0000
committerMike Stump <mrs@apple.com>2009-04-17 00:09:41 +0000
commit397195bf3077fb42789b326f69f7d417227a0588 (patch)
tree462c4f4a1e2977dcfbaa0b6a99d1b9a620d88e43 /lib/Sema/SemaChecking.cpp
parentb14095aa98c6fedd3625920c4ce834bcaf24d9f7 (diff)
Fixup semantic analysis for nested blocks, and allow block literal
expressions that can be of static duration to be returned. Radar 6786551 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 827f63cfcd..8e3a4212e0 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -872,8 +872,9 @@ Sema::CheckReturnStackAddr(Expr *RetValExp, QualType lhsType,
RetValExp = IcExpr->getSubExpr();
if (BlockExpr *C = dyn_cast_or_null<BlockExpr>(RetValExp))
- Diag(C->getLocStart(), diag::err_ret_local_block)
- << C->getSourceRange();
+ if (C->hasBlockDeclRefExprs())
+ Diag(C->getLocStart(), diag::err_ret_local_block)
+ << C->getSourceRange();
}
// Perform checking for stack values returned by reference.
else if (lhsType->isReferenceType()) {