4 fail_compilation/fail11151.d(30): Error: overlapping initialization for field `a` and `y`
8 //extern(C) int printf(const char*, ...);
25 static assert(U
.a
.offsetof
== 0);
26 static assert(U
.b
.offsetof
== 8);
27 static assert(U
.x
.offsetof
== 0);
28 static assert(U
.y
.offsetof
== 4);
30 U u
= {a
:1, y
:2}; // overlapped initializing U.a and U.y
32 //printf("u.a = %lld\n", u.a); // 8589934593 , Wrong!
33 //printf("u.b = %d\n", u.b); // 0
34 //printf("u.x = %d\n", u.x); // 1
35 //printf("u.y = %lld\n", u.y); // 2