From 066f956c80f8bf3ad96e98d0f039001ccbf710bb Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 1 Nov 2007 02:17:02 +0000 Subject: re PR c++/33494 (Broken diagnostic: 'modop_expr' not supported by dump_expr) /cp 2007-10-31 Paolo Carlini PR c++/33494 * cxx-pretty-print.c (pp_cxx_typeid_expression, pp_cxx_delete_expression): Change to static linkage. * cxx-pretty-print.h: Adjust declarations. * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR, MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR, MODOP_EXPR): Forward to pp_expression. * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR): Fix typo. /testsuite 2007-10-31 Paolo Carlini PR c++/33494 * g++.dg/template/error35.C: New. From-SVN: r129815 --- gcc/cp/ChangeLog | 13 +++++++++++++ gcc/cp/cxx-pretty-print.c | 7 ++++--- gcc/cp/cxx-pretty-print.h | 2 -- gcc/cp/error.c | 22 +++++----------------- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 484d152..6ea272f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2007-10-31 Paolo Carlini + + PR c++/33494 + * cxx-pretty-print.c (pp_cxx_typeid_expression, + pp_cxx_delete_expression): Change to static linkage. + * cxx-pretty-print.h: Adjust declarations. + * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR, + MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR, + MODOP_EXPR): Forward to pp_expression. + + * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR): + Fix typo. + 2007-10-31 Christian Bruel Mark Mitchell diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 1de5964..9c5a85f 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -43,6 +43,7 @@ static void pp_cxx_abstract_declarator (cxx_pretty_printer *, tree); static void pp_cxx_statement (cxx_pretty_printer *, tree); static void pp_cxx_template_parameter (cxx_pretty_printer *, tree); static void pp_cxx_cast_expression (cxx_pretty_printer *, tree); +static void pp_cxx_typeid_expression (cxx_pretty_printer *, tree); static inline void @@ -672,7 +673,7 @@ pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) ::(opt) delete cast-expression ::(opt) delete [ ] cast-expression */ -void +static void pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t) { enum tree_code code = TREE_CODE (t); @@ -1064,7 +1065,7 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) case NON_DEPENDENT_EXPR: case MUST_NOT_THROW_EXPR: - pp_cxx_expression (pp, t); + pp_cxx_expression (pp, TREE_OPERAND (t, 0)); break; case EXPR_PACK_EXPANSION: @@ -2161,7 +2162,7 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) } } -void +static void pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t) { t = TREE_OPERAND (t, 0); diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h index 744ee59..e7c4220 100644 --- a/gcc/cp/cxx-pretty-print.h +++ b/gcc/cp/cxx-pretty-print.h @@ -70,9 +70,7 @@ void pp_cxx_separate_with (cxx_pretty_printer *, int); void pp_cxx_declaration (cxx_pretty_printer *, tree); 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_offsetof_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 b949f19..031a221 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1873,10 +1873,6 @@ dump_expr (tree t, int flags) dump_decl (TEMPLATE_PARM_DECL (t), flags & ~TFF_DECL_SPECIFIERS); break; - case SCOPE_REF: - pp_expression (cxx_pp, t); - break; - case CAST_EXPR: if (TREE_OPERAND (t, 0) == NULL_TREE || TREE_CHAIN (TREE_OPERAND (t, 0))) @@ -2004,11 +2000,6 @@ dump_expr (tree t, int flags) dump_expr (TREE_OPERAND (t, 0), flags); break; - case EXPR_PACK_EXPANSION: - dump_expr (PACK_EXPANSION_PATTERN (t), flags); - pp_cxx_identifier (cxx_pp, "..."); - break; - case ARGUMENT_PACK_SELECT: dump_template_argument (ARGUMENT_PACK_SELECT_FROM_PACK (t), flags); break; @@ -2040,10 +2031,6 @@ dump_expr (tree t, int flags) pp_cxx_trait_expression (cxx_pp, t); break; - case TYPEID_EXPR: - pp_cxx_typeid_expression (cxx_pp, t); - break; - case VA_ARG_EXPR: pp_cxx_va_arg_expression (cxx_pp, t); break; @@ -2052,14 +2039,15 @@ dump_expr (tree t, int flags) pp_cxx_offsetof_expression (cxx_pp, t); break; + case SCOPE_REF: + case EXPR_PACK_EXPANSION: + case TYPEID_EXPR: case MEMBER_REF: case DOTSTAR_EXPR: - pp_multiplicative_expression (cxx_pp, t); - break; - case DELETE_EXPR: case VEC_DELETE_EXPR: - pp_cxx_delete_expression (cxx_pp, t); + case MODOP_EXPR: + pp_expression (cxx_pp, t); break; /* This list is incomplete, but should suffice for now. -- cgit v1.1