see https://en.cppreference.com/w/c/language/struct

It seems the 'static' must NOT be used here to get the equivalent behavior of c, when left in the assertions will fail.

Is this expected?

```
unittest
{

struct W
{
align(1):
    long k;
    long l;
}

struct V
{
align(1):
    union // anonymous union
    {
        /*static*/ struct // anonymous structure
        {
            long i;
            long j;
        }
        W w;
   }
   int m;
}

V v1;

v1.i = 2;
assert( 2 == v1.w.k );
v1.w.l = 5;
assert( 5 == v1.j );
}
```




Reply via email to