[cfe-commits] r126053 - in /cfe/trunk/lib/Sema: SemaExprCXX.cpp SemaStmt.cpp

Anders Carlsson andersca at mac.com
Sat Feb 19 13:53:09 PST 2011


Author: andersca
Date: Sat Feb 19 15:53:09 2011
New Revision: 126053

URL: http://llvm.org/viewvc/llvm-project?rev=126053&view=rev
Log:
There's no need to return early if we encounter a try/throw and exceptions are disabled.

Modified:
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/lib/Sema/SemaStmt.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=126053&r1=126052&r2=126053&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sat Feb 19 15:53:09 2011
@@ -477,7 +477,7 @@
 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();

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=126053&r1=126052&r2=126053&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Sat Feb 19 15:53:09 2011
@@ -1742,7 +1742,7 @@
 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 &&





More information about the cfe-commits mailing list