]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl2.c (import_export_decl): Use same_type_p, rather than relying on pointer-equalit...
authorMark Mitchell <mark@codesourcery.com>
Wed, 16 Jun 1999 17:49:59 +0000 (17:49 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 16 Jun 1999 17:49:59 +0000 (17:49 +0000)
* decl2.c (import_export_decl): Use same_type_p, rather than
relying on pointer-equality for types.
* method.c (do_build_copy_constructor): Simplify.

From-SVN: r27556

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

index d2364a8b707cd403cdb2d53d4521e8068421090c..a306376fc57951d6c9682a3346ca5870b60fce9e 100644 (file)
@@ -1,5 +1,10 @@
 1999-06-16  Mark Mitchell  <mark@codesourcery.com>
 
+       * decl2.c (import_export_decl): Use same_type_p, rather than
+       relying on pointer-equality for types.
+
+       * method.c (do_build_copy_constructor): Simplify.
+
        * call.c (build_method_call): Remove bogus code for two-argument
        delete.
        * init.c (build_new_1): Expand on comment, and remove dead code.
index 28382e3d85d1ce594a6812788773716118fc6a84..281ca0c1e82fb34a270a9d7784e2693fa97dcc2b 100644 (file)
@@ -2803,7 +2803,7 @@ import_export_decl (decl)
             since it will not be emitted when the vtable for the type
             is output (which is when the unqualified version is
             generated).  */
-         && ctype == TYPE_MAIN_VARIANT (ctype))
+         && same_type_p (ctype, TYPE_MAIN_VARIANT (ctype)))
        {
          DECL_NOT_REALLY_EXTERN (decl)
            = ! (CLASSTYPE_INTERFACE_ONLY (ctype)
@@ -2814,7 +2814,8 @@ import_export_decl (decl)
          if (flag_weak)
            comdat_linkage (decl);
        }
-      else if (TYPE_BUILT_IN (ctype) && ctype == TYPE_MAIN_VARIANT (ctype))
+      else if (TYPE_BUILT_IN (ctype) 
+              && same_type_p (ctype, TYPE_MAIN_VARIANT (ctype)))
        DECL_NOT_REALLY_EXTERN (decl) = 0;
       else
        comdat_linkage (decl);
index 323aff58ebfd79567e52b737e96a647a68b07674..d4a667bdf82a0f35af0b5df242da0ffcbebac2cb 100644 (file)
@@ -2231,42 +2231,21 @@ do_build_copy_constructor (fndecl)
       tree binfos = TYPE_BINFO_BASETYPES (current_class_type);
       int i;
 
+      /* Initialize all the base-classes.  */
       for (t = CLASSTYPE_VBASECLASSES (current_class_type); t;
           t = TREE_CHAIN (t))
-       {
-         tree basetype = BINFO_TYPE (t);
-         tree p = convert_to_reference
-           (build_reference_type (basetype), parm,
-            CONV_IMPLICIT|CONV_CONST, LOOKUP_COMPLAIN, NULL_TREE);
-         p = convert_from_reference (p);
-
-         if (p == error_mark_node)
-           cp_error ("in default copy constructor");
-         else 
-           current_base_init_list = tree_cons (basetype,
-                                               p, current_base_init_list);
-       }
-       
+       current_base_init_list 
+         = tree_cons (BINFO_TYPE (t), parm, current_base_init_list);
       for (i = 0; i < n_bases; ++i)
        {
-         tree p, basetype = TREE_VEC_ELT (binfos, i);
-         if (TREE_VIA_VIRTUAL (basetype))
+         t = TREE_VEC_ELT (binfos, i);
+         if (TREE_VIA_VIRTUAL (t))
            continue; 
 
-         basetype = BINFO_TYPE (basetype);
-         p = convert_to_reference
-           (build_reference_type (basetype), parm,
-            CONV_IMPLICIT|CONV_CONST, LOOKUP_COMPLAIN, NULL_TREE);
-
-         if (p == error_mark_node) 
-           cp_error ("in default copy constructor");
-         else 
-           {
-             p = convert_from_reference (p);
-             current_base_init_list = tree_cons (basetype,
-                                                 p, current_base_init_list);
-           }
+         current_base_init_list 
+           = tree_cons (BINFO_TYPE (t), parm, current_base_init_list);
        }
+
       for (; fields; fields = TREE_CHAIN (fields))
        {
          tree init, t;