stage2: bitsize of packed struct should trigger backing int ty check
Closes #13398
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user