OSDN Git Service

* decl2.c (comdat_linkage): Treat vtables like functions.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Mar 1999 19:45:25 +0000 (19:45 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Mar 1999 19:45:25 +0000 (19:45 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25985 138bc75d-0d04-0410-961f-82ee72b054a4

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

index b6bff82..187378e 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 8adf5f9..a7cac3e 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;