]> granicus.if.org Git - clang/commitdiff
There's no need to return early if we encounter a try/throw and exceptions are disabled.
authorAnders Carlsson <andersca@mac.com>
Sat, 19 Feb 2011 21:53:09 +0000 (21:53 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 19 Feb 2011 21:53:09 +0000 (21:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126053 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaStmt.cpp

index 07e6b6f14b1f8e20e24bc72fb1d534f14dd670e4..0d48741387a1d9c7ef4c90ed1885c982a91f33ba 100644 (file)
@@ -477,7 +477,7 @@ Sema::ActOnCXXNullPtrLiteral(SourceLocation Loc) {
 ExprResult
 Sema::ActOnCXXThrow(SourceLocation OpLoc, Expr *Ex) {
   if (!getLangOptions().Exceptions)
-    return Diag(OpLoc, diag::err_exceptions_disabled) << "throw";
+    Diag(OpLoc, diag::err_exceptions_disabled) << "throw";
 
   if (Ex && !Ex->isTypeDependent() && CheckCXXThrowOperand(OpLoc, Ex))
     return ExprError();
index 523fc4a852c4c4f8fa42a3c1f5c0cfdcac8ad343..61ab3d3a5bc98192d93bdbfede62ce0b975f662c 100644 (file)
@@ -1742,7 +1742,7 @@ StmtResult
 Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
                        MultiStmtArg RawHandlers) {
   if (!getLangOptions().Exceptions)
-    return Diag(TryLoc, diag::err_exceptions_disabled) << "try";
+    Diag(TryLoc, diag::err_exceptions_disabled) << "try";
 
   unsigned NumHandlers = RawHandlers.size();
   assert(NumHandlers > 0 &&