aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2008-12-18 15:56:12 +0000
committerDJ Delorie <dj@redhat.com>2008-12-18 15:56:12 +0000
commit4e59450ef0333b385bb575153d00942dcd2112fd (patch)
tree655bc06b665704fbc829770938e46e25b85e2c9d /libiberty/cp-demangle.c
parent7d6d7764895f3e08855f574a262e90abebcaa250 (diff)
downloadgdb-4e59450ef0333b385bb575153d00942dcd2112fd.zip
gdb-4e59450ef0333b385bb575153d00942dcd2112fd.tar.gz
gdb-4e59450ef0333b385bb575153d00942dcd2112fd.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index de0d9f7..5ae04c0 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);
@@ -3763,8 +3764,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;