diff options
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 333f6dd255..ef453f5c6a 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -1886,13 +1886,8 @@ Sema::ActOnCapScopeReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) { !(getLangOpts().CPlusPlus && (RetValExp->isTypeDependent() || RetValExp->getType()->isVoidType()))) { - if (!getLangOpts().CPlusPlus && - RetValExp->getType()->isVoidType()) - Diag(ReturnLoc, diag::ext_return_has_void_expr) << "" << 2; - else { - Diag(ReturnLoc, diag::err_return_block_has_expr); - RetValExp = 0; - } + Diag(ReturnLoc, diag::err_return_block_has_expr); + RetValExp = 0; } } else if (!RetValExp) { return StmtError(Diag(ReturnLoc, diag::err_block_return_missing_expr)); |