Browse Source

Code cleanup.

Xiang Li 8 years ago
parent
commit
9f168a8b30
1 changed files with 4 additions and 6 deletions
  1. 4 6
      tools/clang/lib/Parse/ParseExpr.cpp

+ 4 - 6
tools/clang/lib/Parse/ParseExpr.cpp

@@ -307,12 +307,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
           Actions.CorrectDelayedTyposInExpr(LHS);
           LHS = ExprError();
           TernaryMiddle = nullptr;
-        } else {  // HLSL Change Begin - CorrectDelayedTypos for a? b:c.
-           if (LHS.isInvalid()) {
-             // Ensure potential typos in the RHS aren't left undiagnosed.
-             Actions.CorrectDelayedTyposInExpr(TernaryMiddle);
-           }
-        } // HLSL Change End.
+        }
       } else {
         // Special case handling of "X ? Y : Z" where Y is empty:
         //   logical-OR-expression '?' ':' conditional-expression   [GNU]
@@ -466,6 +461,9 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
     } else
       // Ensure potential typos in the RHS aren't left undiagnosed.
       Actions.CorrectDelayedTyposInExpr(RHS);
+      // HLSL Change Begin - Take care TernaryMiddle.
+      Actions.CorrectDelayedTyposInExpr(TernaryMiddle);
+      // HLSL Change End.
   }
 }