summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2016-07-29 00:55:40 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2016-07-29 00:55:40 +0000
commit4c922aba3f75f04ab51ebd9623b89963c2f5dbd2 (patch)
treed554f220a85ade17c98e42280a81ab413b68d68b /clang/lib
parenteb505f9a1c391298f4bb4ba9e85efc706aad6e14 (diff)
downloadbcm5719-llvm-4c922aba3f75f04ab51ebd9623b89963c2f5dbd2.tar.gz
bcm5719-llvm-4c922aba3f75f04ab51ebd9623b89963c2f5dbd2.zip
[Parser] Fix bug where delayed typo in conditional expression was corrected twice
Patch by David Tarditi! Differential revision: https://reviews.llvm.org/D22930 llvm-svn: 277095
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index c71e270cb4c..3788b18f073 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/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()) {
OpenPOWER on IntegriCloud