diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2016-07-29 00:55:40 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2016-07-29 00:55:40 +0000 |
commit | 51a308402a2bb754ced6a783afe977c5b79b82a0 (patch) | |
tree | 38d5d79c8b8ddbd50f9fc49465bf6548fa1dbce8 /lib/Parse/ParseExpr.cpp | |
parent | 61f0900cd1df01830a66c41f14d2f12686af180c (diff) |
[Parser] Fix bug where delayed typo in conditional expression was corrected twice
Patch by David Tarditi!
Differential revision: https://reviews.llvm.org/D22930
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index c71e270cb4..3788b18f07 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -446,14 +446,15 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) { LHS = Actions.ActOnBinOp(getCurScope(), OpToken.getLocation(), OpToken.getKind(), LHS.get(), RHS.get()); - // In this case, ActOnBinOp performed the CorrectDelayedTyposInExpr check. - if (!getLangOpts().CPlusPlus) - continue; } else { LHS = Actions.ActOnConditionalOp(OpToken.getLocation(), ColonLoc, LHS.get(), TernaryMiddle.get(), RHS.get()); } + // In this case, ActOnBinOp or ActOnConditionalOp performed the + // CorrectDelayedTyposInExpr check. + if (!getLangOpts().CPlusPlus) + continue; } // Ensure potential typos aren't left undiagnosed. if (LHS.isInvalid()) { |