Last active
September 18, 2018 17:53
-
-
Save winksaville/8758b59384c7ce0c3604d8b4f708929c to your computer and use it in GitHub Desktop.
compiler aborts when there is a u0 field in a packed struct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = @import("std").debug.assert; | |
// zig: ../src/analyze.cpp:499: ZigType* get_pointer_to_type_extra(CodeGen*, ZigType*, bool, bool, PtrLen, uint32_t, uint32_t, uint32_t): Assertion `byte_alignment == 0' failed. | |
// Aborted (core dumped) | |
test "u0-packed-struct-fails" { | |
const S = packed struct { f0: u0, }; | |
var s = S { .f0 = 0, }; | |
assert(s.f0 == 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment