aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2006-07-13 06:16:59 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2006-07-13 06:16:59 +0000
commit7c0de6a544ba5d293eab1f91b70e017ef5d5834f (patch)
treed0cf7502eabafc2262e5a615fdbd20410a69b531 /gcc/cp/decl2.c
parent72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b (diff)
downloadgcc-7c0de6a544ba5d293eab1f91b70e017ef5d5834f.zip
gcc-7c0de6a544ba5d293eab1f91b70e017ef5d5834f.tar.gz
gcc-7c0de6a544ba5d293eab1f91b70e017ef5d5834f.tar.bz2
Index: ChangeLog
2006-07-12 Geoffrey Keating <geoffk@apple.com> * doc/invoke.texi (C++ Dialect Options): Explain difference between -fvisibility-inlines-hidden and setting hidden visibility explicitly. Index: cp/ChangeLog 2006-07-12 Geoffrey Keating <geoffk@apple.com> * decl2.c (determine_visibility): Don't change visibility of function locals because of -fvisibility-inlines-hidden. Index: testsuite/ChangeLog 2006-07-12 Geoffrey Keating <geoffk@apple.com> * g++.dg/ext/visibility/fvisibility-inlines-hidden-2.C: New. From-SVN: r115411
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index defeafb..3a78c40 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1712,13 +1712,20 @@ determine_visibility (tree decl)
gcc_assert (TREE_CODE (decl) != VAR_DECL
|| !DECL_VTABLE_OR_VTT_P (decl));
- if (DECL_FUNCTION_SCOPE_P (decl))
+ if (DECL_FUNCTION_SCOPE_P (decl) && ! DECL_VISIBILITY_SPECIFIED (decl))
{
/* Local statics and classes get the visibility of their
- containing function. */
+ containing function by default, except that
+ -fvisibility-inlines-hidden doesn't affect them. */
tree fn = DECL_CONTEXT (decl);
- DECL_VISIBILITY (decl) = DECL_VISIBILITY (fn);
- DECL_VISIBILITY_SPECIFIED (decl) = DECL_VISIBILITY_SPECIFIED (fn);
+ if (DECL_VISIBILITY_SPECIFIED (fn) || ! DECL_CLASS_SCOPE_P (fn))
+ {
+ DECL_VISIBILITY (decl) = DECL_VISIBILITY (fn);
+ DECL_VISIBILITY_SPECIFIED (decl) =
+ DECL_VISIBILITY_SPECIFIED (fn);
+ }
+ else
+ determine_visibility_from_class (decl, DECL_CONTEXT (fn));
/* Local classes in templates have CLASSTYPE_USE_TEMPLATE set,
but have no TEMPLATE_INFO, so don't try to check it. */