This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21764] visibility attributes on namespace scope
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2005 06:46:09 -0000
- Subject: [Bug c++/21764] visibility attributes on namespace scope
- References: <bug-21764-365@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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