diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-25 01:54:38 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-25 01:54:38 +0000 |
commit | a4c6081abd5582515b110bdcb576b4b85536467b (patch) | |
tree | b2b49afc3a3bb59884fbcc9d6c177360cdf632b2 /test/SemaCXX/empty-class-layout.cpp | |
parent | a180529e3d5d08dff2e2154d6a33a6c09f6af959 (diff) |
Who would have thought that empty classes were so tricky? Handle cases where an empty virtual base class needs to be moved aside because it conflicts with the first field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/empty-class-layout.cpp')
-rw-r--r-- | test/SemaCXX/empty-class-layout.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/SemaCXX/empty-class-layout.cpp b/test/SemaCXX/empty-class-layout.cpp index fbe2cbe6b4..09e7e4e373 100644 --- a/test/SemaCXX/empty-class-layout.cpp +++ b/test/SemaCXX/empty-class-layout.cpp @@ -28,4 +28,18 @@ SA(4, sizeof(I) == 2); struct J : Empty { Empty e[2]; }; -SA(5, sizeof(J) == 3);
\ No newline at end of file +SA(5, sizeof(J) == 3); + +template<int N> struct Derived : Empty, Derived<N - 1> { +}; +template<> struct Derived<0> : Empty { }; + +struct S1 : virtual Derived<10> { + Empty e; +}; +SA(6, sizeof(S1) == 24); + +struct S2 : virtual Derived<10> { + Empty e[2]; +}; +SA(7, sizeof(S2) == 24); |