Commit 8d4ce389 by Nathan Sidwell Committed by Nathan Sidwell

call.c (build_op_delete_call): Use strip_array_call.

	* call.c (build_op_delete_call): Use strip_array_call. Correct
	error message to say 'delete' or 'delete[]'.

From-SVN: r68536
parent d9e674f7
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> 2003-06-26 Giovanni Bajo <giovannibajo@libero.it>
PR c++/8266 PR c++/8266
......
...@@ -3963,9 +3963,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, ...@@ -3963,9 +3963,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
if (addr == error_mark_node) if (addr == error_mark_node)
return error_mark_node; return error_mark_node;
type = TREE_TYPE (TREE_TYPE (addr)); type = strip_array_types (TREE_TYPE (TREE_TYPE (addr)));
while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
fnname = ansi_opname (code); fnname = ansi_opname (code);
...@@ -4018,7 +4016,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, ...@@ -4018,7 +4016,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
addr = cp_convert (ptr_type_node, addr); addr = cp_convert (ptr_type_node, addr);
/* We make two tries at finding a matching `operator delete'. On /* 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 operator delete. If we're not doing placement delete, then on
the second pass we look for a two-argument delete. */ the second pass we look for a two-argument delete. */
for (pass = 0; pass < (placement ? 1 : 2); ++pass) for (pass = 0; pass < (placement ? 1 : 2); ++pass)
...@@ -4089,7 +4087,8 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, ...@@ -4089,7 +4087,8 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
if (placement) if (placement)
return NULL_TREE; 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; return error_mark_node;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment