From: Anders Carlsson Date: Thu, 27 May 2010 16:15:06 +0000 (+0000) Subject: Another empty class layout test. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bff9eb73031494a7a728ced66d1de150f28fd99f;p=clang Another empty class layout test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104839 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaCXX/empty-class-layout.cpp b/test/SemaCXX/empty-class-layout.cpp index 7d4e66c45f..bc2d58abd9 100644 --- a/test/SemaCXX/empty-class-layout.cpp +++ b/test/SemaCXX/empty-class-layout.cpp @@ -103,10 +103,18 @@ namespace Test3 { // Test that B::a isn't laid out at offset 0. struct Empty { }; struct A { Empty e; }; -struct B : Empty { - A a; -}; - +struct B : Empty { A a; }; 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); + +} \ No newline at end of file