| author | |
| committer | |
| log | 54138d9e82d545094a85435ef862a6d4894e859e |
| tree | 8966cedeb62771f4a19d0e5fc4782b75f4ae19fc |
| parent | 084911d9b376fa9bea2567f53854511adc6d07ec |
1 files changed, 7 insertions(+), 0 deletions(-)
test/cases/union.zig+7| ... | ... | @@ -166,3 +166,10 @@ const PackedPtrOrInt = packed union { |
| 166 | 166 | test "extern union size" { |
| 167 | 167 | comptime assert(@sizeOf(PackedPtrOrInt) == 8); |
| 168 | 168 | } |
| 169 | ||
| 170 | const ZeroBits = union { | |
| 171 | OnlyField: void, | |
| 172 | }; | |
| 173 | test "union with only 1 field which is void should be zero bits" { | |
| 174 | comptime assert(@sizeOf(ZeroBits) == 0); | |
| 175 | } |