diff options
author | Anders Carlsson <andersca@mac.com> | 2010-05-29 19:44:50 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-05-29 19:44:50 +0000 |
commit | 6b0d914ad0f9ec8881e9613b9ce7d027151d00b9 (patch) | |
tree | d77000ee03c67489b0aad5674fdcc9d1135ffb56 /clang/test/SemaCXX/class-layout.cpp | |
parent | a09d95412e98c0ee9e59297b1634e162152037f1 (diff) | |
download | bcm5719-llvm-6b0d914ad0f9ec8881e9613b9ce7d027151d00b9.tar.gz bcm5719-llvm-6b0d914ad0f9ec8881e9613b9ce7d027151d00b9.zip |
Rework the way virtual primary bases are added when laying out classes. Instead of doing it as a separate step, we now use the BaseSubobjectInfo and use it when laying out the bases. This fixes a bug where we would either not add a primary virtual base at all, or add it at the wrong offset.
llvm-svn: 105110
Diffstat (limited to 'clang/test/SemaCXX/class-layout.cpp')
-rw-r--r-- | clang/test/SemaCXX/class-layout.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/class-layout.cpp b/clang/test/SemaCXX/class-layout.cpp index f3c75f4b27d..0a968c70654 100644 --- a/clang/test/SemaCXX/class-layout.cpp +++ b/clang/test/SemaCXX/class-layout.cpp @@ -71,3 +71,17 @@ struct D : C { bool iv0 : 1; }; SA(10, sizeof(D) == 2); } + +namespace Test1 { + +// Test that we don't assert on this hierarchy. +struct A { }; +struct B : A { virtual void b(); }; +class C : virtual A { int c; }; +struct D : virtual B { }; +struct E : C, virtual D { }; +class F : virtual E { }; +struct G : virtual E, F { }; + +SA(0, sizeof(G) == 24); +} |