aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2007-09-27 09:20:59 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2007-09-27 09:20:59 +0000
commit6208170481d560900fd19e3b393c746fd8c0a6e2 (patch)
tree0a7bcbefc643e188970ff9b523de63799fde6768 /gcc/cp
parentc94ed7a1ae35d90b76e04cc7d8a9d72a7aa1451c (diff)
downloadgcc-6208170481d560900fd19e3b393c746fd8c0a6e2.zip
gcc-6208170481d560900fd19e3b393c746fd8c0a6e2.tar.gz
gcc-6208170481d560900fd19e3b393c746fd8c0a6e2.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cxx-pretty-print.c7
-rw-r--r--gcc/cp/cxx-pretty-print.h1
-rw-r--r--gcc/cp/error.c5
4 files changed, 19 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 915ac9e..f459c54 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 9a27ae8..6481273 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -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;
diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
index b653376..66943ac 100644
--- a/gcc/cp/cxx-pretty-print.h
+++ b/gcc/cp/cxx-pretty-print.h
@@ -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 */
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 24f1d83..4337d4d 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -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. */