https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118751
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 60380 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60380&action=edit Self contained dejagnuified testcase Note clang does not error out about the local class example either.