mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
parent
cbed6bb085
commit
ea54c9a375
@ -18232,7 +18232,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
|
||||
var buffer: Value.ToTypeBuffer = undefined;
|
||||
gop.value_ptr.* = .{
|
||||
.ty = try field_type_val.toType(&buffer).copy(new_decl_arena_allocator),
|
||||
.abi_align = @intCast(u32, alignment_val.toUnsignedInt(target)),
|
||||
.abi_align = @intCast(u32, (try alignment_val.getUnsignedIntAdvanced(target, sema.kit(block, src))).?),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -111,6 +111,7 @@ test {
|
||||
_ = @import("behavior/bugs/13159.zig");
|
||||
_ = @import("behavior/bugs/13171.zig");
|
||||
_ = @import("behavior/bugs/13285.zig");
|
||||
_ = @import("behavior/bugs/13435.zig");
|
||||
_ = @import("behavior/byteswap.zig");
|
||||
_ = @import("behavior/byval_arg_var.zig");
|
||||
_ = @import("behavior/call.zig");
|
||||
|
||||
22
test/behavior/bugs/13435.zig
Normal file
22
test/behavior/bugs/13435.zig
Normal file
@ -0,0 +1,22 @@
|
||||
const std = @import("std");
|
||||
|
||||
fn CreateUnion(comptime T: type) type {
|
||||
return @Type(.{
|
||||
.Union = .{
|
||||
.layout = .Auto,
|
||||
.tag_type = null,
|
||||
.fields = &[_]std.builtin.Type.UnionField{
|
||||
.{
|
||||
.name = "field",
|
||||
.field_type = T,
|
||||
.alignment = @alignOf(T),
|
||||
},
|
||||
},
|
||||
.decls = &[_]std.builtin.Type.Declaration{},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
test {
|
||||
_ = CreateUnion(struct {});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user