aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-03-25 19:45:25 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-03-25 14:45:25 -0500
commit2f435bed985ce8b9d3c7bc02a8ae392b61c9b8bd (patch)
treeac48868d9e0d85a369f6d419b9a6439be2802d98
parente55b44863607ba6b2b370f6128a4d423d1a17aee (diff)
downloadgcc-2f435bed985ce8b9d3c7bc02a8ae392b61c9b8bd.zip
gcc-2f435bed985ce8b9d3c7bc02a8ae392b61c9b8bd.tar.gz
gcc-2f435bed985ce8b9d3c7bc02a8ae392b61c9b8bd.tar.bz2
* decl2.c (comdat_linkage): Treat vtables like functions.
From-SVN: r25985
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl2.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b6bff82..187378e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (comdat_linkage): Treat vtables like functions.
+
1999-03-25 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_decl): Tsubst into DECL_BEFRIENDING_CLASSES.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8adf5f9..a7cac3e 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;