merge from gcc
authorDJ Delorie <dj@redhat.com>
Thu, 21 Jan 2010 02:05:11 +0000 (02:05 +0000)
committerDJ Delorie <dj@redhat.com>
Thu, 21 Jan 2010 02:05:11 +0000 (02:05 +0000)
libiberty/ChangeLog
libiberty/cp-demangle.c

index 6d30823569a1e41cb4f81a7b9030cd8e8b37ac35..1e2fbffdf74c11ffa46c95dfdf3a15e9c7f2a3f0 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-20  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42338
+       * cp-demangle.c (d_print_comp): Fix array index printing.
+
 2010-01-11  Tristan Gingold  <gingold@adacore.com>
 
        * cplus-dem.c (ada_demangle): Remove prototype.
index d37c90efc2ddc0955f36c653a8f2824c078d209d..f28e1636921a2c3f7a3b46b8f2cd3a76ce3dd7a0 100644 (file)
@@ -4037,9 +4037,18 @@ d_print_comp (struct d_print_info *dpi,
        d_append_char (dpi, '(');
 
       d_print_subexpr (dpi, d_left (d_right (dc)));
-      if (strcmp (d_left (dc)->u.s_operator.op->code, "cl") != 0)
-       d_print_expr_op (dpi, d_left (dc));
-      d_print_subexpr (dpi, d_right (d_right (dc)));
+      if (strcmp (d_left (dc)->u.s_operator.op->code, "ix") == 0)
+       {
+         d_append_char (dpi, '[');
+         d_print_comp (dpi, d_right (d_right (dc)));
+         d_append_char (dpi, ']');
+       }
+      else
+       {
+         if (strcmp (d_left (dc)->u.s_operator.op->code, "cl") != 0)
+           d_print_expr_op (dpi, d_left (dc));
+         d_print_subexpr (dpi, d_right (d_right (dc)));
+       }
 
       if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR
          && d_left (dc)->u.s_operator.op->len == 1