diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-05-01 20:23:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-05-01 20:23:02 +0000 |
commit | 1b02e4a52d326a9ce4ddf2318ad9d185148db4a7 (patch) | |
tree | 59a63ae313f80be5ec759924317db5c0764d4e4c /clang/lib/Sema/SemaTemplate.cpp | |
parent | 7af363e1ba84dd876e715bb88ba6b58bf3f991b8 (diff) | |
download | bcm5719-llvm-1b02e4a52d326a9ce4ddf2318ad9d185148db4a7.tar.gz bcm5719-llvm-1b02e4a52d326a9ce4ddf2318ad9d185148db4a7.zip |
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>.
llvm-svn: 155935
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index b5b99f978ed..35d3cfa4330 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/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); |