-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.backend-self-hostedbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Milestone
Description
Zig Version
0.16.0-dev.747+493ad58ff
Steps to Reproduce and Observed Behavior
Minimum example I could get it down to:
const std = @import("std");
const T = packed struct {
c: [2]u8,
};
pub fn main() void {
std.debug.print("{}\n", .{ @sizeOf(T) });
}I know packed structs can't contain arrays but we shouldn't get a segfault.
Expected Behavior
This compile error:
test.zig:3:5: error: packed structs cannot contain fields of type '[2]u8'
c: [2]u8,
^~~~~
test.zig:3:5: note: type has no guaranteed in-memory representation
which appears when trying to initialize an object of type T.
rohlem
Metadata
Metadata
Assignees
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.backend-self-hostedbugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior