From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10707 invoked by alias); 13 Dec 2005 06:46:11 -0000 Received: (qmail 10688 invoked by uid 48); 13 Dec 2005 06:46:09 -0000 Date: Tue, 13 Dec 2005 06:46:00 -0000 Message-ID: <20051213064609.10687.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/21764] visibility attributes on namespace scope In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jason at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2005-12/txt/msg01296.txt.bz2 List-Id: ------- 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