diff options
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index ee714e8e24..27696c438f 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -335,15 +335,15 @@ Parser::ParseRHSOfBinaryExpression(OwningExprResult LHS, unsigned MinPrec) { Diag(Tok, diag::ext_gnu_conditional_expr); } - if (Tok.isNot(tok::colon)) { + if (Tok.is(tok::colon)) { + // Eat the colon. + ColonLoc = ConsumeToken(); + } else { Diag(Tok, diag::err_expected_colon) << FixItHint::CreateInsertion(Tok.getLocation(), ": "); Diag(OpToken, diag::note_matching) << "?"; - return ExprError(); + ColonLoc = Tok.getLocation(); } - - // Eat the colon. - ColonLoc = ConsumeToken(); } // Parse another leaf here for the RHS of the operator. |