aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-15 01:44:47 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-15 01:44:47 +0000
commit7d3f576dc9ea6e866757abcd1736eb7e7433c325 (patch)
tree9baa6e6db1f568b9f259e02ea3b759cb6a8d25fb /lib/Sema/SemaTemplate.cpp
parent69456f12c5e5211adbfd7c3500d13436d4fec8da (diff)
When performing qualified name lookup into the current instantiation,
do not look into base classes if there are any dependent base classes. Instead, note in the lookup result that we couldn't look into any dependent bases. Use that new result kind to detect when this case occurs, so that we can fall back to treating the type/value/etc. as a member of an unknown specialization. Fixes an issue where we were resolving lookup at template definition time and then missing an ambiguity at template instantiation time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index d2e70cf9ad..2fad8325d4 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -4769,16 +4769,12 @@ Sema::CheckTypenameType(NestedNameSpecifier *NNS, const IdentifierInfo &II,
Decl *Referenced = 0;
switch (Result.getResultKind()) {
case LookupResult::NotFound:
- if (CurrentInstantiation && CurrentInstantiation->hasAnyDependentBases()) {
- // We performed a lookup in the current instantiation and didn't
- // find anything. However, this current instantiation has
- // dependent bases, so we might be able to find something at
- // instantiation time: just build a TypenameType and move on.
- return Context.getTypenameType(NNS, &II);
- }
-
DiagID = diag::err_typename_nested_not_found;
break;
+
+ case LookupResult::NotFoundInCurrentInstantiation:
+ // Okay, it's a member of an unknown instantiation.
+ return Context.getTypenameType(NNS, &II);
case LookupResult::Found:
if (TypeDecl *Type = dyn_cast<TypeDecl>(Result.getFoundDecl())) {