summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-17 19:08:14 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-17 19:08:14 +0000
commit3986b463f533789a8ff58fc9a1629772c7fbe017 (patch)
tree2fc764010bfc532f00bb2946a496b9d1884f5ed0 /libiberty
parentf4d611a28bed8ce5921fa69355475ffba549a8dd (diff)
downloadgcc-3986b463f533789a8ff58fc9a1629772c7fbe017.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142799 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog7
-rw-r--r--libiberty/cp-demangle.c34
2 files changed, 26 insertions, 15 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a6721bf906d..4eaee542b3b 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 de0d9f7610e..8ab5729dbb7 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: