https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104712
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- You only have a declaration and not a definition. You need to add: int C::XYZZY; And that will fix the issue you are seeing.