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/SemaExpr.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/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 2fa7b2515e..1e04ac734e 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1404,8 +1404,7 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R, std::string CorrectedQuotedStr(Corrected.getQuoted(getLangOptions())); R.setLookupName(Corrected.getCorrection()); - if (!Corrected.isKeyword()) { - NamedDecl *ND = Corrected.getCorrectionDecl(); + if (NamedDecl *ND = Corrected.getCorrectionDecl()) { R.addDecl(ND); if (isa<ValueDecl>(ND) || isa<FunctionTemplateDecl>(ND)) { if (SS.isEmpty()) |