Commit 54138d9e82

Andrew Kelley <superjoe30@gmail.com>
2017-12-04 08:05:33
add test for union with 1 void field being 0 bits
1 parent 084911d
Changed files (1)
test
cases
test/cases/union.zig
@@ -166,3 +166,10 @@ const PackedPtrOrInt = packed union {
 test "extern union size" {
     comptime assert(@sizeOf(PackedPtrOrInt) == 8);
 }
+
+const ZeroBits = union {
+    OnlyField: void,
+};
+test "union with only 1 field which is void should be zero bits" {
+    comptime assert(@sizeOf(ZeroBits) == 0);
+}