diff options
author | Hans Wennborg <hans@hanshq.net> | 2011-07-12 08:45:31 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2011-07-12 08:45:31 +0000 |
commit | 701d1e77aca7e86348386fdeadcd56ca650f95ad (patch) | |
tree | 281a6097d309cdbf2380800c1668b72a67e5ffa9 /lib/Sema/SemaLookup.cpp | |
parent | 91832368ef1c1158c4351bdccaa141dac818f04e (diff) |
Fix typo correction crash on overloaded functions, pr10283.
It would be cool if we could do overload resolution to suggest
the right function, but at least this fixes the crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 0ecd81400b..7d075db0c4 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3744,6 +3744,8 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, case LookupResult::FoundOverloaded: case LookupResult::FoundUnresolvedValue: I->second.setCorrectionDecl(TmpRes.getAsSingle<NamedDecl>()); + // FIXME: This sets the CorrectionDecl to NULL for overloaded functions. + // It would be nice to find the right one with overload resolution. ++I; break; } @@ -3835,7 +3837,6 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, // wasn't actually in scope. if (ED == 0 && Result.isKeyword()) return TypoCorrection(); - assert(Result.isResolved() && "correction has not been looked up"); // Record the correction for unqualified lookup. if (IsUnqualifiedLookup) UnqualifiedTyposCorrected[Typo] = Result; |