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.

llvm-svn: 82746
diff --git a/clang/test/SemaCXX/empty-class-layout.cpp b/clang/test/SemaCXX/empty-class-layout.cpp
index fbe2cbe..09e7e4e 100644
--- a/clang/test/SemaCXX/empty-class-layout.cpp
+++ b/clang/test/SemaCXX/empty-class-layout.cpp
@@ -28,4 +28,18 @@
 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);