From 0ed5edac59d8ee8ad66e9a92763257895008eb8c Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 20 Mar 2006 22:19:06 -0500 Subject: re PR c++/21764 (visibility attributes on namespace scope) 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. From-SVN: r112239 --- gcc/c-pragma.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/c-pragma.h') diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h index 5868f07..6ebb08b 100644 --- a/gcc/c-pragma.h +++ b/gcc/c-pragma.h @@ -75,6 +75,8 @@ extern struct cpp_reader* parse_in; visibility is not supported on the host OS platform the statements are ignored. */ #define HANDLE_PRAGMA_VISIBILITY 1 +extern void push_visibility (const char *); +extern void pop_visibility (void); extern void init_pragma (void); -- cgit v1.1