diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-10 21:59:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-10 21:59:45 +0000 |
commit | a6d1e7623a9b7bd60779275c42827951a892993b (patch) | |
tree | 53a250dc70692b920821adba031551215744b0fa /lib/Sema/SemaTemplate.cpp | |
parent | 94a9016a6b92cfebdb0b7d4dcad930248f1f301a (diff) |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index e960452e06..ded352047a 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/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, |