From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3763 invoked by alias); 21 Mar 2006 03:19:21 -0000 Received: (qmail 3695 invoked by alias); 21 Mar 2006 03:19:11 -0000 Date: Tue, 21 Mar 2006 03:19:00 -0000 Message-ID: <20060321031911.3694.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: 2006-03/txt/msg02005.txt.bz2 List-Id: ------- Comment #11 from jason at gcc dot gnu dot org 2006-03-21 03:19 ------- Subject: Bug 21764 Author: jason Date: Tue Mar 21 03:19:06 2006 New Revision: 112239 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112239 Log: PR c++/21764 * c-pragma.c (visstack): Move out of handle_pragma_visibility. (push_visibility, pop_visibility): Likewise. * c-pragma.h: Declare them. * cp/name-lookup.h (struct cp_binding_level): Add has_visibility bitfield. * cp/name-lookup.c: Include c-pragma.h. (push_namespace_with_attribs): Split out from push_namespace. Push visibility if appropriate. Set TREE_PUBLIC on namespaces. (leave_scope): Pop visibility if appropriate. * cp/parser.c (cp_parser_declaration, cp_parser_namespace_name): Allow attributes on namespace declarations. PR c++/19238 * cp/decl.c (cp_finish_decl): Call determine_visibility later. (start_preparsed_function): Likewise. * cp/cp-tree.h (CP_TYPE_CONTEXT, TYPE_NAMESPACE_SCOPE_P): New macros. (TYPE_CLASS_SCOPE_P, TYPE_FUNCTION_SCOPE_P): New macros. * cp/decl2.c (determine_visibility_from_class): Split out from... (determine_visibility): ...here. Handle function scope and nested classes. (import_export_decl): Move visibility handling to determine_visibility_from_class. Added: trunk/gcc/testsuite/g++.dg/ext/visibility/local1.C trunk/gcc/testsuite/g++.dg/ext/visibility/namespace1.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-pragma.c trunk/gcc/c-pragma.h trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/decl2.c trunk/gcc/cp/name-lookup.c trunk/gcc/cp/name-lookup.h trunk/gcc/cp/parser.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21764