summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/empty-class-layout.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
committerdim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
commitc72c57c9e9b69944e3e009cd5e209634839581d3 (patch)
tree4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaCXX/empty-class-layout.cpp
parent5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff)
downloadFreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip
FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/SemaCXX/empty-class-layout.cpp')
-rw-r--r--test/SemaCXX/empty-class-layout.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/empty-class-layout.cpp b/test/SemaCXX/empty-class-layout.cpp
index 951f16c..3cfc491 100644
--- a/test/SemaCXX/empty-class-layout.cpp
+++ b/test/SemaCXX/empty-class-layout.cpp
@@ -156,3 +156,18 @@ namespace Test7 {
};
SA(0, sizeof(Test) == 2);
}
+
+namespace Test8 {
+ // Test that type sugar doesn't make us incorrectly determine the size of an
+ // array of empty classes.
+ struct Empty1 {};
+ struct Empty2 {};
+ struct Empties : Empty1, Empty2 {};
+ typedef Empty1 Sugar[4];
+ struct A : Empty2, Empties {
+ // This must go at offset 2, because if it were at offset 0,
+ // V[0][1] would overlap Empties::Empty1.
+ Sugar V[1];
+ };
+ SA(0, sizeof(A) == 6);
+}
OpenPOWER on IntegriCloud