https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68085
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- No GCC is correct. C++ says no diagnostic is required for this case; GCC decided that it can diagnostic it. Basically y needs to be referencing to the same decl before and after the finish of the struct if used.