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:
Jacob Young
2024-03-18 15:00:27 +01:00
parent 5a41704f7e
commit 9b2345e182
14 changed files with 2108 additions and 234 deletions

View 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