From 711b299844b8eb77451d96a360f4525fc005279e Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Thu, 17 Jul 2008 14:03:50 +0000 Subject: decl2.c (determine_visibility): Allow target to override visibility of class data. gcc/cp/ * decl2.c (determine_visibility): Allow target to override visibility of class data. gcc/ * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Make no-op for targets which don't use DLLs. gcc/testsuite/ * g++.dg/ext/visibility/arm3.C: Add explanatory text. Skip on non-DLL targets. * g++.dg/ext/visibility/arm1.C: Skip on non-DLL targets. Co-Authored-By: Mark Mitchell From-SVN: r137922 --- gcc/cp/decl2.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/cp/decl2.c') diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a5ece9a..f14f94d 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1963,6 +1963,14 @@ determine_visibility (tree decl) /* tinfo visibility is based on the type it's for. */ constrain_visibility (decl, type_visibility (TREE_TYPE (DECL_NAME (decl)))); + + /* Give the target a chance to override the visibility associated + with DECL. */ + if (TREE_PUBLIC (decl) + && !DECL_REALLY_EXTERN (decl) + && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl))) + && !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE (DECL_NAME (decl)))) + targetm.cxx.determine_class_data_visibility (decl); } else if (use_template) /* Template instantiations and specializations get visibility based -- cgit v1.1