Skip dependent virtual base classes; fixes PR6413.

llvm-svn: 97291
This commit is contained in:
Douglas Gregor 2010-02-27 00:25:28 +00:00
parent 67c0aece75
commit beab56e923
3 changed files with 20 additions and 4 deletions

View File

@ -94,9 +94,7 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
// Keep track of inherited vbases for this base class.
const CXXBaseSpecifier *Base = Bases[i];
QualType BaseType = Base->getType();
// Skip template types.
// FIXME. This means that this list must be rebuilt during template
// instantiation.
// Skip dependent types; we can't do any checking on them now.
if (BaseType->isDependentType())
continue;
CXXRecordDecl *BaseClassDecl
@ -143,6 +141,9 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
data().NumVBases = vbaseCount;
for (int i = 0; i < vbaseCount; i++) {
QualType QT = UniqueVbases[i]->getType();
// Skip dependent types; we can't do any checking on them now.
if (QT->isDependentType())
continue;
CXXRecordDecl *VBaseClassDecl
= cast<CXXRecordDecl>(QT->getAs<RecordType>()->getDecl());
data().VBases[i] =

View File

@ -586,7 +586,10 @@ Sema::ActOnBaseSpecifier(DeclPtrTy classdecl, SourceRange SpecifierRange,
return true;
AdjustDeclIfTemplate(classdecl);
CXXRecordDecl *Class = cast<CXXRecordDecl>(classdecl.getAs<Decl>());
CXXRecordDecl *Class = dyn_cast<CXXRecordDecl>(classdecl.getAs<Decl>());
if (!Class)
return true;
QualType BaseType = GetTypeFromParser(basetype);
if (CXXBaseSpecifier *BaseSpec = CheckBaseSpecifier(Class, SpecifierRange,
Virtual, Access,

View File

@ -109,3 +109,15 @@ namespace PR6081 {
}
};
}
namespace PR6413 {
template <typename T> class Base_A { };
class Base_B { };
template <typename T>
class Derived
: public virtual Base_A<T>
, public virtual Base_B
{ };
}