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.
int i0 = { 17 };
-int test_cond(int y) {
-// CHECK: int x = y ? 1 : 2;
- int x = y ? 1 2;
+int test_cond(int y, int fooBar) {
+// CHECK: int x = y ? 1 : 4+fooBar;
+ int x = y ? 1 4+foobar;
return x;
}