------- Additional Comments From bkoz at gcc dot gnu dot org 2005-05-26 15:57 -------
nested namespaces should work the same as nested classes. :) Since that that doesn't seem to be defined anywhere (am I wrong, or should I open a tracker for that in bugzilla), I'd say: case 1: namespace outer __attribute__ ((visibility ("default") )) { namespace inner __attribute__ ((visibility ("hidden") )) { struct A { int i; }; } } case 2: namespace outer __attribute__ ((visibility ("hidden") )) { namespace inner __attribute__ ((visibility ("default") )) { struct B { int i; }; } } Would have the following, easy (?) semantics: hidden makes all enclosed namespaces hidden. Thus, it really doesn't make sense to nest hidden namespaces. I think the only other reasonable alternative is to say that the nearest scope's visibility attribute is the one in effect. However, I've not really looked at the way nested classes are handled. Any insights there? What ever is done, these two things should be treated consistently. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21764