zig/test/cases/compile_errors/invalid_bit_pointer.zig
Jacob Young 9b2345e182 Sema: rework @fieldParentPtr to accept a pointer type
There is no way to know the expected parent pointer attributes (most
notably alignment) from the type of the field pointer, so provide them
in the first argument.
2024-03-30 20:50:48 -04:00

13 lines
334 B
Zig

comptime {
_ = *align(1:32:4) u8;
}
comptime {
_ = *align(1:25:4) u8;
}
// error
// backend=stage2
// target=native
//
// :2:18: error: packed type 'u8' at bit offset 32 starts 0 bits after the end of a 4 byte host integer
// :5:18: error: packed type 'u8' at bit offset 25 ends 1 bits after the end of a 4 byte host integer