diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-11 22:57:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-11 22:57:37 +0000 |
commit | 4719f4e86a84dec6f5a45771ae51d4ec72e4617a (patch) | |
tree | 3a31494808e31725a262089e6c2fbb6a9f2671de /lib | |
parent | 4f213d3d7427c267776328c419044ed94783241f (diff) |
When performing name lookup within a class template or class template
partial specialization, make sure we look into non-dependent base
classes (but not dependent base classes). Fixes PR4951.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaInherit.cpp | 9 | ||||
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/Sema/SemaInherit.cpp b/lib/Sema/SemaInherit.cpp index e6734d5176..01e856c1d6 100644 --- a/lib/Sema/SemaInherit.cpp +++ b/lib/Sema/SemaInherit.cpp @@ -139,9 +139,12 @@ bool Sema::LookupInBases(CXXRecordDecl *Class, QualType BaseType = Context.getCanonicalType(BaseSpec->getType()); BaseType = BaseType.getUnqualifiedType(); - // If a base class of the class template depends on a template-parameter, - // the base class scope is not examined during unqualified name lookup. - // [temp.dep]p3. + // C++ [temp.dep]p3: + // In the definition of a class template or a member of a class template, + // if a base class of the class template depends on a template-parameter, + // the base class scope is not examined during unqualified name lookup + // either at the point of definition of the class template or member or + // during an instantiation of the class tem- plate or member. if (BaseType->isDependentType()) continue; diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 67674206fb..70befd630c 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1032,9 +1032,8 @@ Sema::LookupQualifiedName(DeclContext *LookupCtx, DeclarationName Name, return LookupResult::CreateLookupResult(Context, I, E); // If this isn't a C++ class, we aren't allowed to look into base - // classes, we're done, or the lookup context is dependent, we're done. - if (RedeclarationOnly || !isa<CXXRecordDecl>(LookupCtx) || - LookupCtx->isDependentContext()) + // classes, we're done. + if (RedeclarationOnly || !isa<CXXRecordDecl>(LookupCtx)) return LookupResult::CreateLookupResult(Context, 0); // Perform lookup into our base classes. |