call.c (build_op_delete_call): Use strip_array_call.
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 26 Jun 2003 15:23:54 +0000 (15:23 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 26 Jun 2003 15:23:54 +0000 (15:23 +0000)
* call.c (build_op_delete_call): Use strip_array_call. Correct
error message to say 'delete' or 'delete[]'.

From-SVN: r68536

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

index 4a36f17..9a22768 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-26  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * call.c (build_op_delete_call): Use strip_array_call. Correct
+       error message to say 'delete' or 'delete[]'.
+
 2003-06-26  Giovanni Bajo  <giovannibajo@libero.it>
 
         PR c++/8266
index 41ad02d..ddc6b4b 100644 (file)
@@ -3963,9 +3963,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
   if (addr == error_mark_node)
     return error_mark_node;
 
-  type = TREE_TYPE (TREE_TYPE (addr));
-  while (TREE_CODE (type) == ARRAY_TYPE)
-    type = TREE_TYPE (type);
+  type = strip_array_types (TREE_TYPE (TREE_TYPE (addr)));
 
   fnname = ansi_opname (code);
 
@@ -4018,7 +4016,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
   addr = cp_convert (ptr_type_node, addr);
 
   /* We make two tries at finding a matching `operator delete'.  On
-     the first pass, we look for an one-operator (or placement)
+     the first pass, we look for a one-operator (or placement)
      operator delete.  If we're not doing placement delete, then on
      the second pass we look for a two-argument delete.  */
   for (pass = 0; pass < (placement ? 1 : 2); ++pass) 
@@ -4089,7 +4087,8 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
   if (placement)
     return NULL_TREE;
 
-  error ("no suitable `operator delete' for `%T'", type);
+  error ("no suitable `operator %s' for `%T'",
+        operator_name_info[(int)code].name, type);
   return error_mark_node;
 }