https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91746
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. this is invalid C++ though there is no diagnostic required by the C++ standard. GCC checks for this case while the other two compilers you citied don't.