if (!LHS.isInvalid() && !Idx.isInvalid() && Tok.is(tok::r_square)) {
LHS = Actions.ActOnArraySubscriptExpr(getCurScope(), LHS.get(), Loc,
Idx.get(), RLoc);
- } else
+ } else {
+ (void)Actions.CorrectDelayedTyposInExpr(LHS);
LHS = ExprError();
+ }
// Match the ']'.
T.consumeClose();
/*AllowDestructorName=*/true,
/*AllowConstructorName=*/
getLangOpts().MicrosoftExt,
- ObjectType, TemplateKWLoc, Name))
+ ObjectType, TemplateKWLoc, Name)) {
+ (void)Actions.CorrectDelayedTyposInExpr(LHS);
LHS = ExprError();
+ }
if (!LHS.isInvalid())
LHS = Actions.ActOnMemberAccessExpr(getCurScope(), LHS.get(), OpLoc,
// If the current evaluation context indicates there are uncorrected typos
// and the current expression isn't guaranteed to not have typos, try to
// resolve any TypoExpr nodes that might be in the expression.
- if (!ExprEvalContexts.empty() && ExprEvalContexts.back().NumTypos &&
+ if (E && !ExprEvalContexts.empty() && ExprEvalContexts.back().NumTypos &&
(E->isTypeDependent() || E->isValueDependent() ||
E->isInstantiationDependent())) {
auto TyposResolved = DelayedTypos.size();