decl2.c (coerce_new_type): Use same_type_p.
authorJason Merrill <jason@yorick.cygnus.com>
Sun, 6 Dec 1998 01:33:10 +0000 (01:33 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 6 Dec 1998 01:33:10 +0000 (20:33 -0500)
* decl2.c (coerce_new_type): Use same_type_p.
(coerce_delete_type): Likewise.
* call.c (check_dtor_name): Return 1, not error_mark_node.

From-SVN: r24122

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

index 8bdd55366a09f31f14257d3d77f951f995a9597c..fa87972bfe76b058a15944fbb7a426094bfbe6aa 100644 (file)
@@ -1,3 +1,10 @@
+1998-12-05  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl2.c (coerce_new_type): Use same_type_p.
+       (coerce_delete_type): Likewise.
+
+       * call.c (check_dtor_name): Return 1, not error_mark_node.
+
 1998-12-04  Jason Merrill  <jason@yorick.cygnus.com>
 
        * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
index cfc94fa67f3c0e9779226c430438b93a55201986..ea8874532ce97cef1068a4b0ae56afa31c47ed84 100644 (file)
@@ -347,8 +347,9 @@ check_dtor_name (basetype, name)
 {
   name = TREE_OPERAND (name, 0);
 
+  /* Just accept something we've already complained about.  */
   if (name == error_mark_node)
-    return error_mark_node;
+    return 1;
 
   if (TREE_CODE (name) == TYPE_DECL)
     name = TREE_TYPE (name);
index 3bcc08dc9f94c613a9b8b10268be84f2f945fdca..f2ba726efabfc6d319dbd13b2097033585c08789 100644 (file)
@@ -2285,15 +2285,14 @@ coerce_new_type (type)
 
   if (TREE_CODE (type) == METHOD_TYPE)
     type = build_function_type (TREE_TYPE (type), TREE_CHAIN (TYPE_ARG_TYPES (type)));
-  if (TREE_TYPE (type) != ptr_type_node)
+  if (! same_type_p (TREE_TYPE (type), ptr_type_node))
     e1 = 1, error ("`operator new' must return type `void *'");
 
   /* Technically the type must be `size_t', but we may not know
      what that is.  */
   if (TYPE_ARG_TYPES (type) == NULL_TREE)
     e1 = 1, error ("`operator new' takes type `size_t' parameter");
-  else if (TREE_CODE (TREE_VALUE (TYPE_ARG_TYPES (type))) != INTEGER_TYPE
-          || TYPE_PRECISION (TREE_VALUE (TYPE_ARG_TYPES (type))) != TYPE_PRECISION (sizetype))
+  else if (! same_type_p (TREE_VALUE (TYPE_ARG_TYPES (type)), sizetype))
     e2 = 1, error ("`operator new' takes type `size_t' as first parameter");
   if (e2)
     type = build_function_type (ptr_type_node, tree_cons (NULL_TREE, sizetype, TREE_CHAIN (TYPE_ARG_TYPES (type))));
@@ -2322,7 +2321,7 @@ coerce_delete_type (type)
     e1 = 1, error ("`operator delete' must return type `void'");
 
   if (arg_types == NULL_TREE
-      || TREE_VALUE (arg_types) != ptr_type_node)
+      || ! same_type_p (TREE_VALUE (arg_types), ptr_type_node))
     e2 = 1, error ("`operator delete' takes type `void *' as first parameter");
 
 #if 0
@@ -2333,8 +2332,7 @@ coerce_delete_type (type)
       /* Again, technically this argument must be `size_t', but again
         we may not know what that is.  */
       tree t2 = TREE_VALUE (TREE_CHAIN (arg_types));
-      if (TREE_CODE (t2) != INTEGER_TYPE
-         || TYPE_PRECISION (t2) != TYPE_PRECISION (sizetype))
+      if (! same_type_p (t2, sizetype))
        e3 = 1, error ("second argument to `operator delete' must be of type `size_t'");
       else if (TREE_CHAIN (TREE_CHAIN (arg_types)) != void_list_node)
        {