https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117679
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- ``` struct A { char u, v, w; }; struct X { char x; }; struct B : X { A y; }; constexpr A f() { union U { A a{ 1, 2, 3 }; B b; } u; u.b.y = u.a; // when does the life time of u.b start, during the statement? return u.b.y; } // ok in GCC and MSVC, fails in Clang static_assert( f().w == 3 ); int main() { return f().w; //2 in GCC with -O0 } ``` So I think this is similar as the above. This produces similar results as GCC, clang, and MSVC for the original testcase. EDG also accepts this code and produces 3 for main. Note I think only GCC -O0 code generation is wrong for main. basic.life/1 says: ``` The lifetime of an object o of type T ends when: ... the storage which the object occupies is released, or is reused by an object that is not nested within o (6.7.2 [intro.object]). ``` But it is not obvious.