From: Jason Merrill Date: Wed, 2 Nov 2016 01:50:29 +0000 (+0000) Subject: Implement P0136R1, Rewording inheriting constructors. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef0f5d7cc3b2082c94beffa7c9c1a8acd8eaa427;p=binutils-gdb.git Implement P0136R1, Rewording inheriting constructors. libiberty/ * cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor. --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 5bd771521ce..5dd812b748a 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2016-11-01 Jason Merrill + + * cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor. + 2016-10-31 Mark Wielaard * cplus-dem.c (ada_demangle): Initialize demangled to NULL and diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index a843dc38f98..46382ccee22 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 a5a658a7095..a56776355bf 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)