forked from OSchip/llvm-project
parent
5fa97f021c
commit
6bb66bbd06
|
@ -173,7 +173,7 @@ void ASTRecordLayoutBuilder::LayoutVirtualBases(const CXXRecordDecl *RD) {
|
|||
e = RD->vbases_end(); i != e; ++i) {
|
||||
const CXXRecordDecl *Base =
|
||||
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
|
||||
if (Base != PrimaryBase)
|
||||
if (!PrimaryBaseWasVirtual || Base != PrimaryBase)
|
||||
LayoutVirtualBase(Base);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,17 @@ int main() {
|
|||
// CHECK-LP64: movl $2, 8(%rax)
|
||||
|
||||
|
||||
struct test6_B2 { virtual void funcB2(); char b[1000]; };
|
||||
struct test6_B1 : virtual test6_B2 { virtual void funcB1(); };
|
||||
|
||||
struct test6_D : test6_B2, virtual test6_B1 {
|
||||
};
|
||||
|
||||
// CEHCK-LP32: .zerofill __DATA, __common, _d6, 2012, 4
|
||||
// CHECK-LP64: .zerofill __DATA, __common, _d6, 2024, 4
|
||||
|
||||
|
||||
|
||||
struct test3_B3 { virtual void funcB3(); };
|
||||
struct test3_B2 : virtual test3_B3 { virtual void funcB2(); };
|
||||
struct test3_B1 : virtual test3_B2 { virtual void funcB1(); };
|
||||
|
@ -370,6 +381,7 @@ struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 {
|
|||
// CHECK-LP64: .quad __ZN2D14bar5Ev
|
||||
|
||||
|
||||
test6_D d6;
|
||||
test5_D d5;
|
||||
test4_D d4;
|
||||
test3_D d3;
|
||||
|
|
Loading…
Reference in New Issue