diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-12 17:06:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-12 17:06:20 +0000 |
commit | c119dd50c28b5d2aa6f34249f6df3cad463e1e5a (patch) | |
tree | a994b71065048f5784346373bad79b11402224ea /clang/lib/Sema/SemaTemplate.cpp | |
parent | d815825c7d8372936d7fb0f28819dd578a8ba1ca (diff) | |
download | bcm5719-llvm-c119dd50c28b5d2aa6f34249f6df3cad463e1e5a.tar.gz bcm5719-llvm-c119dd50c28b5d2aa6f34249f6df3cad463e1e5a.zip |
When determining whether a given name is a template in a dependent
context, do not attempt typo correction. This harms performance (as
Abramo noted) and can cause some amusing errors, as in this new
testcase.
llvm-svn: 93240
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index c4da5a7f09e..d11bf3c0645 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -194,7 +194,8 @@ void Sema::LookupTemplateName(LookupResult &Found, ObjectTypeSearchedInScope = true; } } else if (isDependent) { - // We cannot look into a dependent object type or + // We cannot look into a dependent object type or nested nme + // specifier. return; } else { // Perform unqualified name lookup in the current scope. @@ -205,7 +206,7 @@ void Sema::LookupTemplateName(LookupResult &Found, assert(!Found.isAmbiguous() && "Cannot handle template name-lookup ambiguities"); - if (Found.empty()) { + if (Found.empty() && !isDependent) { // If we did not find any names, attempt to correct any typos. DeclarationName Name = Found.getLookupName(); if (CorrectTypo(Found, S, &SS, LookupCtx)) { |