As per the commentary in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664.
What is desired is to add the visibility attributes to namespace scope, in addition to class scope. So, things like: namespace std __attribute__ ((visibility ("default") )); { class foo { ... }; } when compiled with -fvisibility=hidden would hide all foo symbols, including ctor, dtor, etc. -- Summary: visibility attributes on namespace scope Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bkoz at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21764