summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-12-30 03:39:46 +0000
committerpfg <pfg@FreeBSD.org>2013-12-30 03:39:46 +0000
commit63558da0f9110285f93152cec05f2b2deb11d6b1 (patch)
treeb22ed76aba1e0f646b7ae4bfef96049bf7cc95c9 /contrib/gcc/cp/decl2.c
parent890135ba9f0c849625a36e678b4c38e5fe2eeece (diff)
downloadFreeBSD-src-63558da0f9110285f93152cec05f2b2deb11d6b1.zip
FreeBSD-src-63558da0f9110285f93152cec05f2b2deb11d6b1.tar.gz
MFC r259005, r259092:
gcc: Add -flax-vector-conversions gcc: new fvisibility-ms-compat option These are useful for compatibility with newwer gcc and clang. Obtained from: gcc 4.3 (rev. 120572, 120688, 126088; GPLv2)
Diffstat (limited to 'contrib/gcc/cp/decl2.c')
-rw-r--r--contrib/gcc/cp/decl2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c
index f0b46c9..69cdb99 100644
--- a/contrib/gcc/cp/decl2.c
+++ b/contrib/gcc/cp/decl2.c
@@ -1726,6 +1726,19 @@ determine_visibility (tree decl)
but have no TEMPLATE_INFO, so don't try to check it. */
use_template = 0;
}
+ else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl)
+ && flag_visibility_ms_compat)
+ {
+ /* Under -fvisibility-ms-compat, types are visible by default,
+ even though their contents aren't. */
+ tree underlying_type = TREE_TYPE (DECL_NAME (decl));
+ int underlying_vis = type_visibility (underlying_type);
+ if (underlying_vis == VISIBILITY_ANON
+ || CLASSTYPE_VISIBILITY_SPECIFIED (underlying_type))
+ constrain_visibility (decl, underlying_vis);
+ else
+ DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
+ }
else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl))
{
/* tinfo visibility is based on the type it's for. */
OpenPOWER on IntegriCloud