[Parser] Avoid correcting delayed typos in array subscript multiple times.
We correct some typos in ActOnArraySubscriptExpr and
ActOnOMPArraySectionExpr, so when their result is ExprError, we can
end up correcting delayed typos in the same expressions again. In
general it is OK but when NumTypos is incorrect, we can hit the
Assertion failed: (Entry != DelayedTypos.end() && "Failed to get the state for a TypoExpr!"), function getTypoExprState, file clang/lib/Sema/SemaLookup.cpp, line 5219.
Fix by replacing some subscript ExprResult with typo-corrected expressions
instead of keeping the original expressions. Thus if original expressions
contained TypoExpr, we'll use corrected expressions instead of trying to
correct them again.
Reviewers: rsmith, erik.pilkington, majnemer
Reviewed By: erik.pilkington
Subscribers: jkorous, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D60848