aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl2.cc')
-rw-r--r--gcc/cp/decl2.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc
index 0073f83..9e135af 100644
--- a/gcc/cp/decl2.cc
+++ b/gcc/cp/decl2.cc
@@ -2885,7 +2885,12 @@ min_vis_expr_r (tree *tp, int */*walk_subtrees*/, void *data)
break;
}
addressable:
- if (! TREE_PUBLIC (t))
+ if (decl_linkage (t) == lk_none)
+ tpvis = type_visibility (TREE_TYPE (t));
+ /* Decls that have had their visibility constrained will report
+ as external linkage, but we still want to transitively constrain
+ if we refer to them, so just check TREE_PUBLIC instead. */
+ else if (!TREE_PUBLIC (t))
tpvis = VISIBILITY_ANON;
else
tpvis = DECL_VISIBILITY (t);