https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47877
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Tue Jan 7 15:05:25 2020 New Revision: 279960 URL: https://gcc.gnu.org/viewcvs?rev=279960&root=gcc&view=rev Log: PR c++/47877 - -fvisibility-inlines-hidden and member templates. DECL_VISIBILITY_SPECIFIED is also true if an enclosing scope has explicit visibility, and we don't want that to override -fvisibility-inlines-hidden. So check for the attribute specifically on the function, like we already do for template argument visibility restriction. * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats explicit class visibility for a template. Added: trunk/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden-5.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl2.c trunk/gcc/tree.h