diff options
author | Jason Merrill <jason@redhat.com> | 2008-12-17 14:08:14 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2008-12-17 14:08:14 -0500 |
commit | a77f94e24084115b80f1eb05836d7538b3500c36 (patch) | |
tree | 2fc764010bfc532f00bb2946a496b9d1884f5ed0 /libiberty | |
parent | 3aea2d1ce29ba8a41d54857de2c5bcf1a4dce254 (diff) | |
download | gcc-a77f94e24084115b80f1eb05836d7538b3500c36.zip gcc-a77f94e24084115b80f1eb05836d7538b3500c36.tar.gz gcc-a77f94e24084115b80f1eb05836d7538b3500c36.tar.bz2 |
semantics.c (describable_type): New function.
gcc/cp:
* semantics.c (describable_type): New function.
(finish_decltype_type): Use it for dependent exprs.
* cp-tree.h: Declare it.
* mangle.c (write_type) [DECLTYPE_TYPE]: Set skip_evaluation.
(write_expression): If skip_evaluation, use type stubs.
* tree.c (cp_tree_equal): Handle PARM_DECLs from different
declarations of a function.
* init.c (build_new): Do auto deduction if type is describable.
* decl.c (cp_finish_decl): Likewise.
* parser.c (cp_parser_omp_for_loop): Likewise.
gcc/testsuite:
* g++.dg/cpp0x/auto6.C: Test more stuff.
* g++.dg/cpp0x/auto12.C: New test.
libiberty:
* cp-demangle.c (d_expression): Handle rvalue stubs too.
[DEMANGLE_COMPONENT_CAST]: Update mangling.
(d_print_comp): Avoid extra ", " with empty template argument packs.
Remove handling for obsolete T() mangling.
From-SVN: r142799
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 7 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 34 |
2 files changed, 26 insertions, 15 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index a6721bf..4eaee54 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,10 @@ +2008-12-17 Jason Merrill <jason@redhat.com> + + * cp-demangle.c (d_expression): Handle rvalue stubs too. + [DEMANGLE_COMPONENT_CAST]: Update mangling. + (d_print_comp): Avoid extra ", " with empty template argument packs. + Remove handling for obsolete T() mangling. + 2008-12-10 Jason Merrill <jason@redhat.com> * cp-demangle.c (cplus_demangle_type): Support fixed-point types. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index de0d9f7..8ab5729 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -2561,7 +2561,8 @@ d_expression (struct d_info *di) d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, name, d_template_args (di))); } - else if (peek == 's' && d_peek_next_char (di) == 'T') + else if (peek == 's' + && (d_peek_next_char (di) == 'T' || d_peek_next_char (di) == 'R')) { /* Just demangle a parameter placeholder as its type. */ d_advance (di, 2); @@ -2608,20 +2609,22 @@ d_expression (struct d_info *di) args = op->u.s_extended_operator.args; break; case DEMANGLE_COMPONENT_CAST: - 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; + args = 1; break; } switch (args) { case 1: - return d_make_comp (di, DEMANGLE_COMPONENT_UNARY, op, - d_expression (di)); + { + 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); + } case 2: { struct demangle_component *left; @@ -3763,8 +3766,14 @@ d_print_comp (struct d_print_info *dpi, d_print_comp (dpi, d_left (dc)); if (d_right (dc) != NULL) { + size_t len; d_append_string (dpi, ", "); + len = dpi->len; d_print_comp (dpi, d_right (dc)); + /* If that didn't print anything (which can happen with empty + template argument packs), remove the comma and space. */ + if (dpi->len == len) + dpi->len -= 2; } return; @@ -3800,12 +3809,7 @@ d_print_comp (struct d_print_info *dpi, d_print_cast (dpi, d_left (dc)); d_append_char (dpi, ')'); } - 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)); + d_print_subexpr (dpi, d_right (dc)); return; case DEMANGLE_COMPONENT_BINARY: |