Regression introduced by https://github.com/dlang/dmd/pull/9288 kinke writes: some overlapping fields in the following example apparently don't get their `VarDeclaration.overlapped` flag set: struct SWithUnion { char c; S nested; union { struct { ubyte ub = 6; ushort us = 33; align(8) ulong ul_dummy = void; ulong last = 123; } struct { uint ui1; uint ui2 = 84; ulong ul = 666; } } }
https://run.dlang.io/is/p9cpXq: ``` struct S { union { struct { int a = 123; } struct { int b = 456; } } } void main() { S s; assert(s.b == 123); } ``` Compiles successfully with 2.085.0-beta1, earlier versions rightfully complain: Error: overlapping default initialization for field b and a Error: overlapping default initialization for field a and b
@Basile-z created dlang/dmd pull request #9373 "fix issue 19685 - Revert "aggregate, reduce the complexity of the loo…" fixing this issue: - fix issue 19685 - Revert "aggregate, reduce the complexity of the loop checking the overlapped fields" This reverts commit 2ada2803f40cb59e4528dfadcf824d24e269d1f5. https://github.com/dlang/dmd/pull/9373
@MartinNowak created dlang/dmd pull request #9387 "Merge remote-tracking branch 'upstream/stable' into merge_stable" fixing this issue: - Merge pull request #9373 from Basile-z/issue-19685 fix issue 19685 - Revert "aggregate, reduce the complexity of the loo… merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com> https://github.com/dlang/dmd/pull/9387
dlang/dmd pull request #9387 "Merge remote-tracking branch 'upstream/stable' into merge_stable" was merged into master: - 1ed87aae3546f4d71df1d9e2e85c93d29d07a2b0 by The Dlang Bot: Merge pull request #9373 from Basile-z/issue-19685 fix issue 19685 - Revert "aggregate, reduce the complexity of the loo… merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com> https://github.com/dlang/dmd/pull/9387