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.
This commit is contained in:
13
test/cases/compile_errors/invalid_bit_pointer.zig
Normal file
13
test/cases/compile_errors/invalid_bit_pointer.zig
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
Reference in New Issue
Block a user