PR7800: both virtual and non-virtual bases must be marked as used for VTTs.

llvm-svn: 110526
This commit is contained in:
Eli Friedman 2010-08-07 23:11:44 +00:00
parent f387dbde81
commit aab1fda91f
2 changed files with 16 additions and 2 deletions

View File

@ -6797,8 +6797,6 @@ void Sema::MarkVirtualMembersReferenced(SourceLocation Loc,
e = RD->bases_end(); i != e; ++i) {
const CXXRecordDecl *Base =
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
if (i->isVirtual())
continue;
if (Base->getNumVBases() == 0)
continue;
MarkVirtualMembersReferenced(Loc, Base);

View File

@ -0,0 +1,16 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR7800
class NoDestroy { ~NoDestroy(); }; // expected-note {{declared private here}}
struct A {
virtual ~A();
};
struct B : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct D : public virtual B {
virtual void foo();
~D();
};
void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
}