https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106150
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2022-07-01 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >The following is valid, No the code is invalid but because of the non-trival deconstructor of V. Here is an example which is valid (after https://cplusplus.github.io/CWG/issues/2084.html): struct S1 { S1(); }; struct S { S(); }; union U { S s{}; S1 s1; } u; The check in GCC for this seems to be off, if only the variant s is there, GCC (and clang) accepts it. So the full check for the defect report was never really done (and it was not even mentioned in the defect report commentary either).