forked from OSchip/llvm-project
PR7800: both virtual and non-virtual bases must be marked as used for VTTs.
llvm-svn: 110526
This commit is contained in:
parent
f387dbde81
commit
aab1fda91f
|
@ -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);
|
||||
|
|
|
@ -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}}
|
||||
}
|
Loading…
Reference in New Issue