diff options
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 8841dec..5246a7f 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2210,8 +2210,12 @@ maybe_make_one_only (decl) make_decl_one_only (decl); - if (TREE_CODE (decl) == VAR_DECL && DECL_LANG_SPECIFIC (decl)) - DECL_COMDAT (decl) = 1; + if (TREE_CODE (decl) == VAR_DECL) + { + DECL_COMDAT (decl) = 1; + /* Mark it needed so we don't forget to emit it. */ + TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = 1; + } } /* Returns the virtual function with which the vtable for TYPE is |