* decl2.c (comdat_linkage): Treat vtables like functions.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 25 Mar 1999 19:45:25 +0000 (19:45 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 25 Mar 1999 19:45:25 +0000 (14:45 -0500)
From-SVN: r25985

gcc/cp/ChangeLog
gcc/cp/decl2.c

index b6bff825ff76ddbc6c8ceed5fb620fb60ff5f493..187378eccf72f1902863adb6e2ee1301370213bb 100644 (file)
@@ -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.
index 8adf5f95df90dccf7d70141bebfd354417f152c6..a7cac3e9b634791d8eadcedeac4dc829dfb303cc 100644 (file)
@@ -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;