1 From: "H dot J dot Lu" <hjl at lucon dot org>
2 Subject: PATCH: PR 19664: Don't change visibility if set by user
4 This patch may fix visibility push(default)/pop. When visibility
5 has been set by user, we shouldn't change it.
8 2005-02-03 H.J. Lu <hongjiu.lu@intel.com>
11 * decl2.c (determine_visibility): Don't set visibility to
12 hidden if it has been set explicitly by user.
14 --- gcc-4.0.0/gcc/cp/decl2.c.orig 2005-04-05 17:38:09.000000000 +0200
15 +++ gcc-4.0.0/gcc/cp/decl2.c 2005-05-05 00:41:14.000000000 +0200
16 @@ -1636,8 +1636,12 @@
17 && DECL_DECLARED_INLINE_P (decl)
18 && visibility_options.inlines_hidden)
20 - DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
21 - DECL_VISIBILITY_SPECIFIED (decl) = 1;
22 + /* Don't change it if it has been set explicitly by user. */
23 + if (!DECL_VISIBILITY_SPECIFIED (decl))
25 + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
26 + DECL_VISIBILITY_SPECIFIED (decl) = 1;
29 else if (CLASSTYPE_VISIBILITY_SPECIFIED (class_type))