aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.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
commitc50a4a5f2eac14ac4c631d50b0a55cadc87700ce (patch)
tree694ec8327f92d8727d2c3db3bcd4f77a1db29e85 /lib/Sema/SemaStmt.cpp
parentd452758bb6b59340528a26def9ecc24b329d4ecf (diff)
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... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index d7a812cb2a..3cadd526a7 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -678,9 +678,10 @@ Sema::ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
// If this is the first return we've seen in the block, infer the type of
// the block from it.
if (CurBlock->ReturnType == 0) {
- if (RetValExp)
+ if (RetValExp) {
+ UsualUnaryConversions(RetValExp);
CurBlock->ReturnType = RetValExp->getType().getTypePtr();
- else
+ } else
CurBlock->ReturnType = Context.VoidTy.getTypePtr();
return new ReturnStmt(ReturnLoc, RetValExp);
}