1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
void T2() { struct Y { double d; }; struct X { struct Y y; int i; }; constexpr struct Y y = { 3.0 }; constexpr struct X x = { y, 2 }; static_assert(x.y.d == 3.0); static_assert(x.i == 2); }