diff options
author | Paolo Carlini <pcarlini@suse.de> | 2007-09-18 18:05:40 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2007-09-18 18:05:40 +0000 |
commit | fdb8f4189ccfe9ef56ffb438ee8d4e98902bbfdc (patch) | |
tree | 429400c1361e2c95bd0f6bf59f5584a1f07a9599 /gcc/cp | |
parent | 6b9de967764c7d77ee1572a578f292d6afe40280 (diff) | |
download | gcc-fdb8f4189ccfe9ef56ffb438ee8d4e98902bbfdc.zip gcc-fdb8f4189ccfe9ef56ffb438ee8d4e98902bbfdc.tar.gz gcc-fdb8f4189ccfe9ef56ffb438ee8d4e98902bbfdc.tar.bz2 |
re PR c++/33462 (Broken diagnostic: 'va_arg_expr' not supported by dump_expr)
/cp
2007-09-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33462
* cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
(pp_cxx_primary_expression): Use it.
* cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
* error.c (dump_expr): Use it.
/testsuite
2007-09-18 Paolo Carlini <pcarlini@suse.de>
PR c++/33462
* g++.dg/ext/va-arg1.C: New.
From-SVN: r128584
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/cxx-pretty-print.c | 17 | ||||
-rw-r--r-- | gcc/cp/cxx-pretty-print.h | 1 | ||||
-rw-r--r-- | gcc/cp/error.c | 4 |
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 504a0c3..6f9e04d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,13 @@ 2007-09-18 Paolo Carlini <pcarlini@suse.de> + PR c++/33462 + * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add. + (pp_cxx_primary_expression): Use it. + * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare. + * error.c (dump_expr): Use it. + +2007-09-18 Paolo Carlini <pcarlini@suse.de> + PR c++/33463 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split out case TYPEID_EXPR to... diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index a73a052..b660f53 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -351,6 +351,8 @@ pp_cxx_id_expression (cxx_pretty_printer *pp, tree t) id-expression GNU Extensions: + __builtin_va_arg ( assignment-expression , type-id ) + __has_nothrow_assign ( type-id ) __has_nothrow_constructor ( type-id ) __has_nothrow_copy ( type-id ) @@ -410,6 +412,10 @@ pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t) pp_cxx_trait_expression (pp, t); break; + case VA_ARG_EXPR: + pp_cxx_va_arg_expression (pp, t); + break; + default: pp_c_primary_expression (pp_c_base (pp), t); break; @@ -2153,6 +2159,17 @@ pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t) } void +pp_cxx_va_arg_expression (cxx_pretty_printer *pp, tree t) +{ + pp_cxx_identifier (pp, "__builtin_va_arg"); + pp_cxx_left_paren (pp); + pp_cxx_assignment_expression (pp, TREE_OPERAND (t, 0)); + pp_cxx_separate_with (pp, ','); + pp_cxx_type_id (pp, TREE_TYPE (t)); + pp_cxx_right_paren (pp); +} + +void pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t) { cp_trait_kind kind = TRAIT_EXPR_KIND (t); diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h index f399fea..b653376 100644 --- a/gcc/cp/cxx-pretty-print.h +++ b/gcc/cp/cxx-pretty-print.h @@ -71,5 +71,6 @@ 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); #endif /* GCC_CXX_PRETTY_PRINT_H */ diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 1854fd6..602426a 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2062,6 +2062,10 @@ dump_expr (tree t, int flags) pp_cxx_typeid_expression (cxx_pp, t); break; + case VA_ARG_EXPR: + pp_cxx_va_arg_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. */ |