This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/21764] visibility attributes on namespace scope



------- Comment #10 from jason at gcc dot gnu dot org  2005-12-13 06:46 -------
The semantics of this feature are pretty obvious for simple testcases.  But
since there's no One Definition Rule for namespaces, it's perfectly valid for
different chunks of the same namespace to have different attributes.

So, if you have:

namespace Foo __attribute ((visibility ("hidden"))
{
  void f();
}

namespace Foo
{
  void g();
}

what is the visibility of Foo::g?  Should the namespace extension inherit the
visibility of the previous namespace definition, or should visibility
attributes only affect declarations within that specific block?

If the former, should we only allow attributes on the first definition of a
particular namespace in a translation unit?  That was my initial assumption,
but then I realized that's not very composable.  On the other hand, perhaps if
we're going to specify visibility for a namespace, we want it to be applied
consistently to everything in the namespace.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]