https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121250
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2025-07-25 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. clang is the only compiler which rejects this (that is MSVC and EDG also accepts it). clang does not reject the case where the variable is unrelated derived class from A (but that is PR 105277).