On 25/01/2012 03:27, Rafael Ávila de Espíndola wrote: > Sorry, one more case that gcc accepts where it is not clear what the > result should be: > > ----------------------------- > #pragma GCC visibility push(protected) > > int x; > class __attribute__((visibility("hidden"))) foo { > static int a; > #pragma GCC visibility pop > static int b; > }; > int y; > > int foo::a; > int foo::b; > ----------------------------- > > Should this be reject (as happens with namespaces)? If not what is the > expected result? Currently we get > > x -> protected > y -> default > a -> hidden > b -> hidden
According to the manual: > In C++, `#pragma GCC visibility' affects only namespace-scope > declarations. Class members and template specializations are not > affected; if you want to override the visibility for a particular > member or instantiation, you must use an attribute. Looks like it's working to me. cheers, DaveK