瀏覽代碼

Code cleanup.

Xiang Li 8 年之前
父節點
當前提交
9f168a8b30
共有 1 個文件被更改,包括 4 次插入6 次删除
  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);
           Actions.CorrectDelayedTyposInExpr(LHS);
           LHS = ExprError();
           LHS = ExprError();
           TernaryMiddle = nullptr;
           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 {
       } else {
         // Special case handling of "X ? Y : Z" where Y is empty:
         // Special case handling of "X ? Y : Z" where Y is empty:
         //   logical-OR-expression '?' ':' conditional-expression   [GNU]
         //   logical-OR-expression '?' ':' conditional-expression   [GNU]
@@ -466,6 +461,9 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
     } else
     } else
       // Ensure potential typos in the RHS aren't left undiagnosed.
       // Ensure potential typos in the RHS aren't left undiagnosed.
       Actions.CorrectDelayedTyposInExpr(RHS);
       Actions.CorrectDelayedTyposInExpr(RHS);
+      // HLSL Change Begin - Take care TernaryMiddle.
+      Actions.CorrectDelayedTyposInExpr(TernaryMiddle);
+      // HLSL Change End.
   }
   }
 }
 }