diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-25 19:45:25 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-03-25 19:45:25 +0000 |
commit | efa0614df549cc1c8995f467ff37c84dd720686a (patch) | |
tree | ac48868d9e0d85a369f6d419b9a6439be2802d98 /gcc/cp/decl2.c | |
parent | a69c9ae5c6229d1212874c45016ffcb35229cc82 (diff) | |
download | gcc-efa0614df549cc1c8995f467ff37c84dd720686a.tar.gz |
* decl2.c (comdat_linkage): Treat vtables like functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25985 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 8adf5f95df9..a7cac3e9b63 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2370,10 +2370,14 @@ comdat_linkage (decl) { if (flag_weak) make_decl_one_only (decl); - else if (TREE_CODE (decl) == FUNCTION_DECL) + else if (TREE_CODE (decl) == FUNCTION_DECL || DECL_VIRTUAL_P (decl)) + /* We can just emit functions and vtables statically; it doesn't really + matter if we have multiple copies. */ TREE_PUBLIC (decl) = 0; else { + /* Static data member template instantiations, however, cannot + have multiple copies. */ if (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node) DECL_COMMON (decl) = 1; |