https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113958
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I am not 100% sure if type_visibility is needed here or in general. You can also use -fvisibility-inlines-hidden to hide methods that are declared as inline which I suspect you want really too.