aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-12-06 01:33:10 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-12-05 20:33:10 -0500
commitee996e9e57af9f194a3c5678729283a3d2aaf66b (patch)
treea7a2348a5c52c1ad0e3dc39dcfbe28b9fdd4ad7f /gcc
parent02e3377d92148cb2d53d58aec19ce080107db49b (diff)
downloadgcc-ee996e9e57af9f194a3c5678729283a3d2aaf66b.zip
gcc-ee996e9e57af9f194a3c5678729283a3d2aaf66b.tar.gz
gcc-ee996e9e57af9f194a3c5678729283a3d2aaf66b.tar.bz2
decl2.c (coerce_new_type): Use same_type_p.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/call.c3
-rw-r--r--gcc/cp/decl2.c10
3 files changed, 13 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8bdd553..fa87972 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index cfc94fa..ea88745 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 3bcc08d..f2ba726 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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)
{