diff options
Diffstat (limited to 'clang/lib/Parse/ParseExpr.cpp')
-rw-r--r-- | clang/lib/Parse/ParseExpr.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index 43929c0bcf2..eeea15dec05 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -1364,8 +1364,10 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { 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(); @@ -1536,8 +1538,10 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { /*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, |