aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-05-01 20:23:02 +0000
committerDouglas Gregor <dgregor@apple.com>2012-05-01 20:23:02 +0000
commit05e6076f0a02dbb73d20a3928976bcd242a13279 (patch)
tree3ccc70ec3695c7ccc39ba11513e22892ecfaead6 /lib/Sema/SemaTemplate.cpp
parentd53f6971a7c97c9a564c9a7b3b1dd773d120aac8 (diff)
In C++11 mode, implement the C++11 semantics for
[basic.lookup.classref]p1 and p4, which concerns name lookup for nested-name-specifiers and template names, respectively, in a member access expression. C++98/03 forces us to look both in the scope of the object and in the current scope, then compare the results. C++11 just takes the result from the scope of the object, if something is found. Fixes <rdar://problem/11328502>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index b5b99f978e..35d3cfa433 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -354,12 +354,14 @@ void Sema::LookupTemplateName(LookupResult &Found,
return;
}
- if (S && !ObjectType.isNull() && !ObjectTypeSearchedInScope) {
- // C++ [basic.lookup.classref]p1:
+ if (S && !ObjectType.isNull() && !ObjectTypeSearchedInScope &&
+ !(getLangOpts().CPlusPlus0x && !Found.empty())) {
+ // C++03 [basic.lookup.classref]p1:
// [...] If the lookup in the class of the object expression finds a
// template, the name is also looked up in the context of the entire
// postfix-expression and [...]
//
+ // Note: C++11 does not perform this second lookup.
LookupResult FoundOuter(*this, Found.getLookupName(), Found.getNameLoc(),
LookupOrdinaryName);
LookupName(FoundOuter, S);