re PR c++/38561 (Revision 142799 may cause C++ demangle failures)

PR c++/38561
        * cp-demangle.c (d_expression, d_print_comp): Revert
        cast changes.

From-SVN: r142814
This commit is contained in:
Jason Merrill 2008-12-18 09:51:56 -05:00 committed by Jason Merrill
parent 0dec126200
commit 938e76ad6d
2 changed files with 20 additions and 11 deletions

View File

@ -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.

View File

@ -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: