diff options
Diffstat (limited to 'lib/Sema/SemaCXXScopeSpec.cpp')
-rw-r--r-- | lib/Sema/SemaCXXScopeSpec.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index 5a0fceca20..3a884a95a1 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -539,8 +539,9 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, NamedDecl *SD = Found.getAsSingle<NamedDecl>(); if (isAcceptableNestedNameSpecifier(SD)) { - if (!ObjectType.isNull() && !ObjectTypeSearchedInScope) { - // C++ [basic.lookup.classref]p4: + if (!ObjectType.isNull() && !ObjectTypeSearchedInScope && + !getLangOpts().CPlusPlus0x) { + // C++03 [basic.lookup.classref]p4: // [...] If the name is found in both contexts, the // class-name-or-namespace-name shall refer to the same entity. // @@ -548,6 +549,8 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, // into the current scope (the scope of the postfix-expression) to // see if we can find the same name there. As above, if there is no // scope, reconstruct the result from the template instantiation itself. + // + // Note that C++11 does *not* perform this redundant lookup. NamedDecl *OuterDecl; if (S) { LookupResult FoundOuter(*this, &Identifier, IdentifierLoc, |