[Issue 19685] Nested aggregate overlaps not detected

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 18 23:30:57 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19685

kinke at gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #1 from kinke at gmx.net ---
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

--


More information about the Digitalmars-d-bugs mailing list