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

          Issue ID: 20342
           Summary: GDC - assignment to anonymous union member corrupts
                    data
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

```
union U
{
    struct
    {
        size_t a;
        size_t b;
        union
        {
            size_t c;
            size_t d;
        }
    }
}

void main()
{
    U u;
    assert(u.a == 0); // ok
    u.d = 1;
    assert(u.a == 0); // error
}
```

--

Reply via email to