Implement P0136R1, Rewording inheriting constructors.
authorJason Merrill <jason@redhat.com>
Wed, 2 Nov 2016 01:50:29 +0000 (01:50 +0000)
committerMark Wielaard <mark@klomp.org>
Fri, 18 Nov 2016 10:06:18 +0000 (11:06 +0100)
libiberty/
* cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor.

libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/testsuite/demangle-expected

index 5bd771521cedfdae3e4f708ff7348ee14c3c7be7..5dd812b748a4246cfccb9104550b154a779c925b 100644 (file)
@@ -1,3 +1,7 @@
+2016-11-01  Jason Merrill  <jason@redhat.com>
+
+       * cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor.
+
 2016-10-31  Mark Wielaard  <mjw@redhat.com>
 
        * cplus-dem.c (ada_demangle): Initialize demangled to NULL and
index a843dc38f98c42ea0e6fd7a27d307d37dad27035..46382ccee22e2d4c96c92feee50af7c7fcb4b836 100644 (file)
@@ -2168,6 +2168,13 @@ d_ctor_dtor_name (struct d_info *di)
     case 'C':
       {
        enum gnu_v3_ctor_kinds kind;
+       int inheriting = 0;
+
+       if (d_peek_next_char (di) == 'I')
+         {
+           inheriting = 1;
+           d_advance (di, 1);
+         }
 
        switch (d_peek_next_char (di))
          {
@@ -2189,7 +2196,12 @@ d_ctor_dtor_name (struct d_info *di)
          default:
            return NULL;
          }
+
        d_advance (di, 2);
+
+       if (inheriting)
+         cplus_demangle_type (di);
+
        return d_make_ctor (di, kind, di->last_name);
       }
 
index a5a658a7095948fd17edf5a11bfb88a1b83d8f05..a56776355bfe0cbb53993b6b0e15e8bcfb7a644a 100644 (file)
@@ -4592,3 +4592,7 @@ __t2m05B500000000000000000_
 
 __10%0__S4_0T0T0
 %0<>::%0(%0<>)
+
+# Inheriting constructor
+_ZN1DCI11BEi
+D::B(int)