diff options
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index ab96f7416f..aba38db035 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -8902,7 +8902,12 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, ExprCleanupObjects.push_back(Result->getBlockDecl()); ExprNeedsCleanups = true; } - + + if (BSI->TheDecl->blockMissingReturnType() && + !RetTy->isDependentType() && + !Context.getCanonicalType(RetTy)->isVoidType()) + Diag(CaretLoc, diag::warn_block_missing_return_type); + return Owned(Result); } |