diff options
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index eb6366c02e0..5390c3dbb6c 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -4400,12 +4400,11 @@ retry_lookup: return TC; } - // If this was an unqualified lookup and we believe the callback object did - // not filter out possible corrections, note that no correction was found. - if (IsUnqualifiedLookup && !ValidatingCallback) - (void)UnqualifiedTyposCorrected[Typo]; - - return FailedCorrection(Typo, TypoName.getLoc(), RecordFailure); + // Record the failure's location if needed and return an empty correction. If + // this was an unqualified lookup and we believe the callback object did not + // filter out possible corrections, also cache the failure for the typo. + return FailedCorrection(Typo, TypoName.getLoc(), RecordFailure, + IsUnqualifiedLookup && !ValidatingCallback); } void TypoCorrection::addCorrectionDecl(NamedDecl *CDecl) { |