diff options
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index e0eb1ac..0cf6b4e 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2123,6 +2123,11 @@ decl_linkage (tree decl) /* Things that are TREE_PUBLIC have external linkage. */ if (TREE_PUBLIC (decl)) return lk_external; + + /* Linkage of a CONST_DECL depends on the linkage of the enumeration + type. */ + if (TREE_CODE (decl) == CONST_DECL) + return decl_linkage (TYPE_NAME (TREE_TYPE (decl))); /* Some things that are not TREE_PUBLIC have external linkage, too. For example, on targets that don't have weak symbols, we make all |