[cfe-commits] r139252 - in /cfe/trunk: lib/Sema/SemaLookup.cpp test/SemaCXX/using-decl-templates.cpp
Douglas Gregor
dgregor at apple.com
Wed Sep 7 13:32:30 PDT 2011
On Sep 7, 2011, at 1:25 PM, Kaelyn Uhrain wrote:
> Author: rikka
> Date: Wed Sep 7 15:25:59 2011
> New Revision: 139252
>
> URL: http://llvm.org/viewvc/llvm-project?rev=139252&view=rev
> Log:
> Fix Sema::CorrectTypo to ignore found but unresolved symbols
Why ignore unresolved symbols? It seems like we can typo-correct to them, even though we don't know what they'll eventually resolve to.
- Doug
> Modified:
> cfe/trunk/lib/Sema/SemaLookup.cpp
> cfe/trunk/test/SemaCXX/using-decl-templates.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=139252&r1=139251&r2=139252&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaLookup.cpp Wed Sep 7 15:25:59 2011
> @@ -3691,6 +3691,7 @@
> 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 @@
> }
>
> case LookupResult::Found:
> - case LookupResult::FoundUnresolvedValue:
> I->second.setCorrectionDecl(TmpRes.getAsSingle<NamedDecl>());
> ++I;
> break;
> @@ -3754,7 +3754,6 @@
>
> switch (TmpRes.getResultKind()) {
> case LookupResult::Found:
> - case LookupResult::FoundUnresolvedValue:
> Consumer.addName((*QRI)->getName(), TmpRes.getAsSingle<NamedDecl>(),
> QualifiedED, NI->NameSpecifier);
> break;
> @@ -3771,6 +3770,7 @@
> case LookupResult::NotFound:
> case LookupResult::NotFoundInCurrentInstantiation:
> case LookupResult::Ambiguous:
> + case LookupResult::FoundUnresolvedValue:
> break;
> }
> }
>
> Modified: cfe/trunk/test/SemaCXX/using-decl-templates.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/using-decl-templates.cpp?rev=139252&r1=139251&r2=139252&view=diff
> ==============================================================================
> --- cfe/trunk/test/SemaCXX/using-decl-templates.cpp (original)
> +++ cfe/trunk/test/SemaCXX/using-decl-templates.cpp Wed Sep 7 15:25:59 2011
> @@ -63,3 +63,20 @@
> };
> 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'}}
> + };
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list