Another empty class layout test.

llvm-svn: 104839
This commit is contained in:
Anders Carlsson 2010-05-27 16:15:06 +00:00
parent 1ff101cb1a
commit 3e88da9fe5
1 changed files with 12 additions and 4 deletions

View File

@ -103,10 +103,18 @@ namespace Test3 {
// Test that B::a isn't laid out at offset 0. // Test that B::a isn't laid out at offset 0.
struct Empty { }; struct Empty { };
struct A { Empty e; }; struct A { Empty e; };
struct B : Empty { struct B : Empty { A a; };
A a;
};
SA(0, sizeof(B) == 2); SA(0, sizeof(B) == 2);
} }
namespace Test4 {
// Test that C::Empty isn't laid out at offset 0.
struct Empty { };
struct A : Empty { };
struct B { A a; };
struct C : B, Empty { };
SA(0, sizeof(C) == 2);
}