aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-08 00:36:37 +0000
committerChris Lattner <sabre@nondot.org>2009-09-08 00:36:37 +0000
commit4ca606e898293ae58f1793f988500e2218c7a9be (patch)
treebc9493beed3da592bfed7316589d5ad1698671cc /lib/Sema/SemaChecking.cpp
parentcbff0dc7fefe37bcef9044ec89e9f1131f3c76a9 (diff)
reject returning a block expr even when it has parens and casts in the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 24eb8b1d5e..a63e044272 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -1254,9 +1254,7 @@ Sema::CheckReturnStackAddr(Expr *RetValExp, QualType lhsType,
<< DR->getDecl()->getDeclName() << RetValExp->getSourceRange();
// Skip over implicit cast expressions when checking for block expressions.
- if (ImplicitCastExpr *IcExpr =
- dyn_cast_or_null<ImplicitCastExpr>(RetValExp))
- RetValExp = IcExpr->getSubExpr();
+ RetValExp = RetValExp->IgnoreParenCasts();
if (BlockExpr *C = dyn_cast_or_null<BlockExpr>(RetValExp))
if (C->hasBlockDeclRefExprs())