This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 03/10] Implement P0136R1, Rewording inheriting constructors.
- From: Mark Wielaard <mark at klomp dot org>
- To: binutils at sourceware dot org
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Thu, 17 Nov 2016 01:42:02 +0100
- Subject: [PATCH 03/10] Implement P0136R1, Rewording inheriting constructors.
- Authentication-results: sourceware.org; auth=none
- References: <1479343329-16165-1-git-send-email-mark@klomp.org>
From: Jason Merrill <jason@redhat.com>
libiberty/
* cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor.
---
libiberty/ChangeLog | 4 ++++
libiberty/cp-demangle.c | 12 ++++++++++++
libiberty/testsuite/demangle-expected | 4 ++++
3 files changed, 20 insertions(+)
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 5bd7715..5dd812b 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -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
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index a843dc3..46382cc 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -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);
}
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index a5a658a..a567763 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4592,3 +4592,7 @@ __t2m05B500000000000000000_
__10%0__S4_0T0T0
%0<>::%0(%0<>)
+
+# Inheriting constructor
+_ZN1DCI11BEi
+D::B(int)
--
1.8.3.1