diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-18 14:51:56 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-18 14:51:56 +0000 |
commit | 43247f5f79431bbf49ed2d7d6a9e8e4d696cbd3f (patch) | |
tree | e33eecd70302ce8615d9753fc35fc2589c6a514c /libiberty | |
parent | b5b6da9ccfec51dfcf24c832220ca0c4119a5650 (diff) | |
download | gcc-43247f5f79431bbf49ed2d7d6a9e8e4d696cbd3f.tar.gz |
PR c++/38561
* cp-demangle.c (d_expression, d_print_comp): Revert
cast changes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142814 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 6 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 25 |
2 files changed, 20 insertions, 11 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 4eaee542b3b..f46fe05f379 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2008-12-18 Jason Merrill <jason@redhat.com> + + PR c++/38561 + * cp-demangle.c (d_expression, d_print_comp): Revert + cast changes. + 2008-12-17 Jason Merrill <jason@redhat.com> * cp-demangle.c (d_expression): Handle rvalue stubs too. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 8ab5729dbb7..5ae04c068f1 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -2609,22 +2609,20 @@ d_expression (struct d_info *di) args = op->u.s_extended_operator.args; break; case DEMANGLE_COMPONENT_CAST: - args = 1; + if (d_peek_char (di) == 'v') + /* T() encoded as an operand of void. */ + return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op, + cplus_demangle_type (di)); + else + args = 1; break; } switch (args) { case 1: - { - struct demangle_component *operand; - if (op->type == DEMANGLE_COMPONENT_CAST) - operand = d_exprlist (di); - else - operand = d_expression (di); - return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op, - operand); - } + return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op, + d_expression (di)); case 2: { struct demangle_component *left; @@ -3809,7 +3807,12 @@ d_print_comp (struct d_print_info *dpi, d_print_cast (dpi, d_left (dc)); d_append_char (dpi, ')'); } - d_print_subexpr (dpi, d_right (dc)); + if (d_left (dc)->type == DEMANGLE_COMPONENT_CAST + && d_right (dc)->type == DEMANGLE_COMPONENT_BUILTIN_TYPE) + /* type() -- FIXME what about type(multiple,args) */ + d_append_string (dpi, "()"); + else + d_print_subexpr (dpi, d_right (dc)); return; case DEMANGLE_COMPONENT_BINARY: |