}
}
+ ExprResult OrigLHS = LHS;
if (!LHS.isInvalid()) {
// Combine the LHS and RHS into the LHS (e.g. build AST).
if (TernaryMiddle.isInvalid()) {
LHS = Actions.ActOnBinOp(getCurScope(), OpToken.getLocation(),
OpToken.getKind(), LHS.get(), RHS.get());
- } else
+ } else {
LHS = Actions.ActOnConditionalOp(OpToken.getLocation(), ColonLoc,
LHS.get(), TernaryMiddle.get(),
RHS.get());
- } else {
- // Ensure potential typos aren't left undiagnosed.
+ }
+ }
+ // Ensure potential typos aren't left undiagnosed.
+ if (LHS.isInvalid()) {
+ Actions.CorrectDelayedTyposInExpr(OrigLHS);
Actions.CorrectDelayedTyposInExpr(TernaryMiddle);
Actions.CorrectDelayedTyposInExpr(RHS);
}
}
int d = ? L : d; // expected-error {{expected expression}} expected-error {{undeclared identifier}}
+
+struct B0 {
+ int : 0 | // expected-error {{invalid operands to binary expression}}
+ (struct B0)e; // expected-error {{use of undeclared identifier}}
+};