merge from gcc
authorDJ Delorie <dj@redhat.com>
Fri, 4 Nov 2011 14:32:13 +0000 (14:32 +0000)
committerDJ Delorie <dj@redhat.com>
Fri, 4 Nov 2011 14:32:13 +0000 (14:32 +0000)
libiberty/ChangeLog
libiberty/cp-demangle.c

index 8ff403b..559f0c9 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/48370
+       * cp-demangle.c (d_special_name, d_print_comp): Handle a
+       discriminator number on DEMANGLE_COMPONENT_REFTEMP.
+
 2011-11-02  Doug Evans  <dje@google.com>
 
        * Makefile.in (CFILES): Add timeval-utils.c.
index c7afef0..d0f57b7 100644 (file)
@@ -1846,8 +1846,11 @@ d_special_name (struct d_info *di)
          return d_make_comp (di, DEMANGLE_COMPONENT_GUARD, d_name (di), NULL);
 
        case 'R':
-         return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, d_name (di),
-                             NULL);
+         {
+           struct demangle_component *name = d_name (di);
+           return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, name,
+                               d_number_component (di));
+         }
 
        case 'A':
          return d_make_comp (di, DEMANGLE_COMPONENT_HIDDEN_ALIAS,
@@ -3921,7 +3924,9 @@ d_print_comp (struct d_print_info *dpi, int options,
       return;
 
     case DEMANGLE_COMPONENT_REFTEMP:
-      d_append_string (dpi, "reference temporary for ");
+      d_append_string (dpi, "reference temporary #");
+      d_print_comp (dpi, options, d_right (dc));
+      d_append_string (dpi, " for ");
       d_print_comp (dpi, options, d_left (dc));
       return;