------- Comment #9 from geoffk at geoffk dot org  2005-11-18 19:39 -------
Subject: Re:  visibility attributes on namespace scope


On 17/11/2005, at 10:15 PM, jason at redhat dot com wrote:

> ------- Comment #8 from jason at redhat dot com  2005-11-18 06:15  
> -------
> Subject: Re:  visibility attributes on namespace scope
>
> bkoz at gcc dot gnu dot org wrote:
>> What do you mean, "less or equal visibility to their enclosing  
>> scope?"
>
> Where default > protected > hidden > internal, if a class or namespace
> has a specified visibility, nested scopes should have the same
> visibility or something later in the above sequence.

Although this makes sense for classes, I'm not sure it does for  
namespaces:

namespace foo __attribute__((visibility("hidden"))) {
   void foo();
   void bar() __attribute__((visibility("default")));
}

This seems reasonable to me; the attribute on the namespace is  
setting a default, which is overridden on bar().


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21764

Reply via email to