From: "H dot J dot Lu" Subject: PATCH: PR 19664: Don't change visibility if set by user This patch may fix visibility push(default)/pop. When visibility has been set by user, we shouldn't change it. 2005-02-03 H.J. Lu PR C++/19664 * decl2.c (determine_visibility): Don't set visibility to hidden if it has been set explicitly by user. --- gcc-4.0.0/gcc/cp/decl2.c.orig 2005-04-05 17:38:09.000000000 +0200 +++ gcc-4.0.0/gcc/cp/decl2.c 2005-05-05 00:41:14.000000000 +0200 @@ -1636,8 +1636,12 @@ && DECL_DECLARED_INLINE_P (decl) && visibility_options.inlines_hidden) { - DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; - DECL_VISIBILITY_SPECIFIED (decl) = 1; + /* Don't change it if it has been set explicitly by user. */ + if (!DECL_VISIBILITY_SPECIFIED (decl)) + { + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + DECL_VISIBILITY_SPECIFIED (decl) = 1; + } } else if (CLASSTYPE_VISIBILITY_SPECIFIED (class_type)) {