summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-09-16 22:25:10 +0000
committerSteve Naroff <snaroff@apple.com>2008-09-16 22:25:10 +0000
commit3b1e172d7ef08504b001aac21a15ada002d0993e (patch)
tree8a06b53bb9173261a7da1eee5e6122e8cb685f28 /clang/lib/Sema/SemaChecking.cpp
parent64d6c6fe301b987afba0cb07961400d11e463967 (diff)
downloadbcm5719-llvm-3b1e172d7ef08504b001aac21a15ada002d0993e.tar.gz
bcm5719-llvm-3b1e172d7ef08504b001aac21a15ada002d0993e.zip
Sema::ActOnBlockReturnStmt(): Need to perform the UsualUnaryConversions on the return type.
Sema::CheckReturnStackAddr(): Make sure we skip over implicit casts. Added some more test cases... llvm-svn: 56254
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 00b469b7c05..f870e26b6a3 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -716,7 +716,12 @@ Sema::CheckReturnStackAddr(Expr *RetValExp, QualType lhsType,
Diag(DR->getLocStart(), diag::warn_ret_stack_addr,
DR->getDecl()->getIdentifier()->getName(),
RetValExp->getSourceRange());
-
+
+ // Skip over implicit cast expressions when checking for block expressions.
+ if (ImplicitCastExpr *IcExpr =
+ dyn_cast_or_null<ImplicitCastExpr>(RetValExp))
+ RetValExp = IcExpr->getSubExpr();
+
if (BlockExpr *C = dyn_cast_or_null<BlockExpr>(RetValExp))
Diag(C->getLocStart(), diag::err_ret_local_block,
C->getSourceRange());
OpenPOWER on IntegriCloud