Open wooster0 opened 1 month ago
Wonder why this check (apparently?) isn't working:
Aside: Doing nothing at all for the zero-sized case is very surprising behavior IMO. I would expect the instruction to at least result in a fence corresponding to the given ordering, even if no store actually takes place; the fence has implications for code other than the store itself. (And likewise for atomic loads.)
The problem is not with that check but with this one: https://github.com/ziglang/zig/blob/4d81e8ee915c3e012131cf90ed87cc8c6a01a934/src/Sema.zig#L27601
Using u1
gives the expected error:
a.zig:1:17: error: extern variable cannot have type 'u1'
extern const a: u1;
^~
a.zig:1:17: note: only integers with 0, 8, 16, 32, 64 and 128 bits are extern compatible
referenced by:
x: a.zig:4:17
x: a.zig:3:1
4 reference(s) hidden; use '-freference-trace=6' to see all references
Regressed in #16404, fix is to check the position
.
Zig Version
0.14.0-dev.1511+54b668f8a
Steps to Reproduce and Observed Behavior
Expected Behavior
A successful compilation.