stage2: bitsize of packed struct should trigger backing int ty check

Closes #13398
This commit is contained in:
Veikka Tuominen
2022-11-04 18:47:52 +02:00
parent 51b1083d66
commit f92e7bed7b
2 changed files with 18 additions and 7 deletions

View File

@@ -0,0 +1,13 @@
const Foo = packed struct(u32) {
x: u1,
};
fn bar(_: Foo) callconv(.C) void {}
pub export fn entry() void {
bar(.{ .x = 0 });
}
// error
// backend=stage2
// target=native
//
// :1:27: error: backing integer type 'u32' has bit size 32 but the struct fields have a total bit size of 1