Open nektro opened 8 months ago
(Per #19149, it doesn't matter whether the undefined
field is a default or explicit init.)
This happens only when the entire struct value is comptime-known. The problem is that logic in Sema.validateStructInit
(and similarly for unions) is performing an optimization: if all RLS field stores are comptime-known, the entire struct is converted into a comptime constant. That's great for backends, since it gives them more freedom in lowering, but it's a case not correctly detected by the LLVM backend's undefined
detection logic for valgrind.
Zig Version
0.12.0-dev.3142+9d500bda2
Steps to Reproduce and Observed Behavior
Expected Behavior