]> granicus.if.org Git - clang/commitdiff
minor simplification
authorChris Lattner <sabre@nondot.org>
Sun, 6 Apr 2008 06:03:03 +0000 (06:03 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Apr 2008 06:03:03 +0000 (06:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49267 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseExprCXX.cpp

index c98a7f91f8b154dacb27ce07a88fc41443db5b83..a71eb4807b241c0742e2994bb3b8d38e4cb61524 100644 (file)
@@ -83,10 +83,8 @@ Parser::ExprResult Parser::ParseCXXBoolLiteral() {
 ///         'throw' assignment-expression[opt]
 Parser::ExprResult Parser::ParseThrowExpression() {
   assert(Tok.is(tok::kw_throw) && "Not throw!");
-
-  ExprResult Expr;
-
   SourceLocation ThrowLoc = ConsumeToken();           // Eat the throw token.
+  
   // If the current token isn't the start of an assignment-expression,
   // then the expression is not present.  This handles things like:
   //   "C ? throw : (void)42", which is crazy but legal.
@@ -100,7 +98,7 @@ Parser::ExprResult Parser::ParseThrowExpression() {
     return Actions.ActOnCXXThrow(ThrowLoc);
 
   default:
-    Expr = ParseAssignmentExpression();
+    ExprResult Expr = ParseAssignmentExpression();
     if (Expr.isInvalid) return Expr;
     return Actions.ActOnCXXThrow(ThrowLoc, Expr.Val);
   }