Backport:

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.

	* g++.dg/template/error31.C: New.

From-SVN: r131267
This commit is contained in:
Volker Reichelt
2008-01-02 23:47:08 +00:00
committed by Volker Reichelt
parent 18d4211a60
commit ea8198876c
6 changed files with 27 additions and 2 deletions

View File

@@ -1,6 +1,14 @@
2008-01-02 Volker Reichelt <reichelt@netcologne.de>
Backport:
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-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33462

View File

@@ -604,7 +604,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);
@@ -615,10 +615,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

@@ -71,6 +71,7 @@ void pp_cxx_declaration (cxx_pretty_printer *, tree);
void pp_cxx_canonical_template_parameter (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

@@ -1901,6 +1901,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,6 +1,11 @@
2008-01-02 Volker Reichelt <reichelt@netcologne.de>
Backport:
2007-09-27 Paolo Carlini <pcarlini@suse.de>
PR c++/33493
* g++.dg/template/error31.C: New.
2007-09-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33462

View File

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