diff options
author | Kaelyn Uhrain <rikka@google.com> | 2011-09-07 20:25:59 +0000 |
---|---|---|
committer | Kaelyn Uhrain <rikka@google.com> | 2011-09-07 20:25:59 +0000 |
commit | 82340e8cbd353ae4ddb545f61ba9816c8d69ba8e (patch) | |
tree | 112880aabce0ecafe2b6d7ad2802a42d269fd683 | |
parent | 3f5af5d7934847db4a76d034ba3ccd7cb2655cda (diff) |
Fix Sema::CorrectTypo to ignore found but unresolved symbols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139252 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 4 | ||||
-rw-r--r-- | test/SemaCXX/using-decl-templates.cpp | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index c5dc144695..f11737b9f7 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3691,6 +3691,7 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, switch (TmpRes.getResultKind()) { case LookupResult::NotFound: case LookupResult::NotFoundInCurrentInstantiation: + case LookupResult::FoundUnresolvedValue: QualifiedResults.insert(Name); // We didn't find this name in our scope, or didn't like what we found; // ignore it. @@ -3717,7 +3718,6 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, } case LookupResult::Found: - case LookupResult::FoundUnresolvedValue: I->second.setCorrectionDecl(TmpRes.getAsSingle<NamedDecl>()); ++I; break; @@ -3754,7 +3754,6 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, switch (TmpRes.getResultKind()) { case LookupResult::Found: - case LookupResult::FoundUnresolvedValue: Consumer.addName((*QRI)->getName(), TmpRes.getAsSingle<NamedDecl>(), QualifiedED, NI->NameSpecifier); break; @@ -3771,6 +3770,7 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, case LookupResult::NotFound: case LookupResult::NotFoundInCurrentInstantiation: case LookupResult::Ambiguous: + case LookupResult::FoundUnresolvedValue: break; } } diff --git a/test/SemaCXX/using-decl-templates.cpp b/test/SemaCXX/using-decl-templates.cpp index 7b4da9d50d..2f8abca02d 100644 --- a/test/SemaCXX/using-decl-templates.cpp +++ b/test/SemaCXX/using-decl-templates.cpp @@ -63,3 +63,20 @@ template <class T> struct Bar : public Foo<T>, Baz { }; template int Bar<int>::foo(); } + +// PR10883 +namespace PR10883 { + template <typename T> + class Base { + public: + typedef long Container; + }; + + template <typename T> + class Derived : public Base<T> { + public: + using Base<T>::Container; + + void foo(const Container& current); // expected-error {{unknown type name 'Container'}} + }; +} |