re PR c++/33493 (Broken diagnostic: 'dl_expr' not supported by dump_expr)

/cp
2007-09-27  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33493
	* error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
	* cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
	spaces in the formatting.
	* cxx-pretty-print.h (pp_cxx_delete_expression): Declare.

/testsuite
2007-09-27  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33493
	* g++.dg/template/error31.C: New.

From-SVN: r128831
This commit is contained in:
Paolo Carlini 2007-09-27 09:20:59 +00:00 committed by Paolo Carlini
parent c94ed7a1ae
commit 6208170481
6 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2007-09-27 Paolo Carlini <pcarlini@suse.de>
PR c++/33493
* error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
* cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
spaces in the formatting.
* cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
2007-09-27 Jakub Jelinek <jakub@redhat.com>
* error.c (cxx_print_error_function): Add third argument, pass

View File

@ -662,7 +662,7 @@ pp_cxx_new_expression (cxx_pretty_printer *pp, tree t)
::(opt) delete cast-expression
::(opt) delete [ ] cast-expression */
static void
void
pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
{
enum tree_code code = TREE_CODE (t);
@ -673,10 +673,13 @@ pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
if (DELETE_EXPR_USE_GLOBAL (t))
pp_cxx_colon_colon (pp);
pp_cxx_identifier (pp, "delete");
if (code == VEC_DELETE_EXPR)
pp_space (pp);
if (code == VEC_DELETE_EXPR
|| DELETE_EXPR_USE_VEC (t))
{
pp_left_bracket (pp);
pp_right_bracket (pp);
pp_space (pp);
}
pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0));
break;

View File

@ -72,5 +72,6 @@ void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree);
void pp_cxx_trait_expression (cxx_pretty_printer *, tree);
void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
void pp_cxx_va_arg_expression (cxx_pretty_printer *, tree);
void pp_cxx_delete_expression (cxx_pretty_printer *, tree);
#endif /* GCC_CXX_PRETTY_PRINT_H */

View File

@ -2066,6 +2066,11 @@ dump_expr (tree t, int flags)
pp_cxx_va_arg_expression (cxx_pp, t);
break;
case DELETE_EXPR:
case VEC_DELETE_EXPR:
pp_cxx_delete_expression (cxx_pp, t);
break;
/* This list is incomplete, but should suffice for now.
It is very important that `sorry' does not call
`report_error_function'. That could cause an infinite loop. */

View File

@ -1,3 +1,8 @@
2007-09-27 Paolo Carlini <pcarlini@suse.de>
PR c++/33493
* g++.dg/template/error31.C: New.
2007-09-27 Jakub Jelinek <jakub@redhat.com>
* lib/prune.exp: Prune also "^In function .*$" lines and

View File

@ -0,0 +1,3 @@
// PR c++/33493
template<int> void foo() { delete 0 ? 1 : 0; } // { dg-error "delete 0" }