From: Kaelyn Uhrain Date: Wed, 7 Sep 2011 20:25:59 +0000 (+0000) Subject: Fix Sema::CorrectTypo to ignore found but unresolved symbols X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82340e8cbd353ae4ddb545f61ba9816c8d69ba8e;p=clang 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 --- 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()); ++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(), 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 struct Bar : public Foo, Baz { }; template int Bar::foo(); } + +// PR10883 +namespace PR10883 { + template + class Base { + public: + typedef long Container; + }; + + template + class Derived : public Base { + public: + using Base::Container; + + void foo(const Container& current); // expected-error {{unknown type name 'Container'}} + }; +}