aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-11-02 01:50:29 +0000
committerMark Wielaard <mark@klomp.org>2016-11-18 11:06:18 +0100
commitef0f5d7cc3b2082c94beffa7c9c1a8acd8eaa427 (patch)
treeacf76115758d10542892bd26416076864d3c03e3
parentaba19b625f34fb3d61263fe8044cf0c6d8804570 (diff)
downloadbinutils-ef0f5d7cc3b2082c94beffa7c9c1a8acd8eaa427.zip
binutils-ef0f5d7cc3b2082c94beffa7c9c1a8acd8eaa427.tar.gz
binutils-ef0f5d7cc3b2082c94beffa7c9c1a8acd8eaa427.tar.bz2
Implement P0136R1, Rewording inheriting constructors.
libiberty/ * cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor.
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/cp-demangle.c12
-rw-r--r--libiberty/testsuite/demangle-expected4
3 files changed, 20 insertions, 0 deletions
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)