summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-10 21:59:45 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-10 21:59:45 +0000
commitde0a43f7720259290fd8f7032420b990d771bb52 (patch)
tree1435781d190cbd1b1c721925c5c569bb67a76249 /clang/lib/Sema/SemaTemplate.cpp
parent1d9d5e93d12d83c5bffb6039bf37580da32357f5 (diff)
downloadbcm5719-llvm-de0a43f7720259290fd8f7032420b990d771bb52.tar.gz
bcm5719-llvm-de0a43f7720259290fd8f7032420b990d771bb52.zip
When performing the lookup in the current scope for a member access to
a member template, e.g., x.f<int> if we have found a template in the type of x, but the lookup in the current scope is ambiguous, just ignore the lookup in the current scope. Fixes <rdar://problem/9915664>. llvm-svn: 137255
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index e960452e06a..ded352047a1 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -344,10 +344,12 @@ void Sema::LookupTemplateName(LookupResult &Found,
if (FoundOuter.empty()) {
// - if the name is not found, the name found in the class of the
// object expression is used, otherwise
- } else if (!FoundOuter.getAsSingle<ClassTemplateDecl>()) {
+ } else if (!FoundOuter.getAsSingle<ClassTemplateDecl>() ||
+ FoundOuter.isAmbiguous()) {
// - if the name is found in the context of the entire
// postfix-expression and does not name a class template, the name
// found in the class of the object expression is used, otherwise
+ FoundOuter.clear();
} else if (!Found.isSuppressingDiagnostics()) {
// - if the name found is a class template, it must refer to the same
// entity as the one found in the class of the object expression,
OpenPOWER on IntegriCloud