From 134e805d3e18cf700a5046912b8dca9301fe6f2e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 1 Mar 2017 15:09:29 +0000 Subject: Sync libiberty sources with GCC mainline. Brings in: 2017-01-18 Markus Trippelsdorf PR PR c++/70182 * cp-demangle.c (d_unqualified_name): Handle "on" for operator names. * testsuite/demangle-expected: Add tests. 2017-01-18 Markus Trippelsdorf PR c++/77489 * cp-demangle.c (d_discriminator): Handle discriminator >= 10. * testsuite/demangle-expected: Add tests for discriminator. 2016-12-13 Jakub Jelinek PR c++/78761 * cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto). * testsuite/demangle-expected: Add test for decltype(auto). --- libiberty/ChangeLog | 64 +++++++++++++++++++++++------------ libiberty/cp-demangle.c | 24 +++++++++++-- libiberty/testsuite/demangle-expected | 23 +++++++++++++ 3 files changed, 87 insertions(+), 24 deletions(-) (limited to 'libiberty') diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index de41f89..0c5972a 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,6 +1,30 @@ +2017-01-18 Markus Trippelsdorf + + PR PR c++/70182 + * cp-demangle.c (d_unqualified_name): Handle "on" for + operator names. + * testsuite/demangle-expected: Add tests. + +2017-01-18 Markus Trippelsdorf + + PR c++/77489 + * cp-demangle.c (d_discriminator): Handle discriminator >= 10. + * testsuite/demangle-expected: Add tests for discriminator. + +2017-01-04 Jakub Jelinek + + Update copyright years. + 2017-01-04 Alan Modra - Sync with gcc. + * Makefile.in (configure_deps): Update. + * configure: Regenerate. + +2016-12-13 Jakub Jelinek + + PR c++/78761 + * cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto). + * testsuite/demangle-expected: Add test for decltype(auto). 2016-12-12 Nathan Sidwell @@ -14,16 +38,24 @@ is_lambda_arg. : Increment is_lambda_arg around arg printing. - * testsuite/demangle-expected: Add lambda auto mangling cases. - -2016-12-08 Alan Modra - - * configure: Regenerate. + * testsuite/demangle-expected: Add lambda auto mangling cases. 2016-12-06 DJ Delorie * argv.c (expandargv): Check for directories passed as @-files. +2016-11-30 David Malcolm + + PR c/78498 + * strndup.c (strlen): Delete decl. + (strnlen): Add decl. + (strndup): Call strnlen rather than strlen. + * xstrndup.c (xstrndup): Likewise. + +2016-11-29 Nathan Sidwell + + * cp-demangle.c (d_print_comp_inner): Fix parameter indentation. + 2016-11-03 David Tolnay Mark Wielaard @@ -90,10 +122,6 @@ * cplus-dem.c (ada_demangle): Initialize demangled to NULL and XDELETEVEC demangled when unknown. -2016-10-17 Nick Clifton - - * Sync with gcc. - 2016-09-19 Andrew Stubbs * pex-win32.c (argv_to_cmdline): Quote zero-length parameters. @@ -349,11 +377,7 @@ (d_print_mod_list, d_print_mod, d_print_function_type) (is_ctor_or_dtor): Handle DEMANGLE_COMPONENT_TRANSACTION_SAFE. -2015-09-30 Nick Clifton - - Import the following patches from the GCC mainline: - - 2015-08-15 Ian Lance Taylor +2015-08-15 Ian Lance Taylor * cp-demangle.c (d_abi_tags): Preserve di->last_name across any ABI tags. @@ -365,10 +389,6 @@ * testsuite/d-demangle-expected: Update float and complex literal tests to check correct hexadecimal demangling. -2015-07-14 H.J. Lu - - * configure: Regenerated. - 2015-07-13 Mikhail Maltsev * cp-demangle.c (d_dump): Fix syntax error. @@ -510,8 +530,8 @@ * functions.texi: Regenerate. 2014-12-11 Uros Bizjak - Ben Elliston - Manuel Lopez-Ibanez + Ben Elliston + Manuel Lopez-Ibanez * xvasprintf.c: New file. * vprintf-support.h: Likewise. @@ -736,7 +756,7 @@ (d_ctor_dtor_name): Handle unified ctor/dtor. 2013-11-22 Cary Coutant - + PR other/59195 * cp-demangle.c (struct d_info_checkpoint): New struct. (struct d_print_info): Add current_template field. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 15ef3b4..f0dbf93 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1594,6 +1594,8 @@ d_unqualified_name (struct d_info *di) ret = d_source_name (di); else if (IS_LOWER (peek)) { + if (peek == 'o' && d_peek_next_char (di) == 'n') + d_advance (di, 2); ret = d_operator_name (di); if (ret != NULL && ret->type == DEMANGLE_COMPONENT_OPERATOR) { @@ -3609,7 +3611,11 @@ d_local_name (struct d_info *di) } } -/* ::= _ <(non-negative) number> +/* ::= _ # when number < 10 + ::= __ _ # when number >= 10 + + ::= _ # when number >=10 + is also accepted to support gcc versions that wrongly mangled that way. We demangle the discriminator, but we don't print it out. FIXME: We should print it out in verbose mode. */ @@ -3617,14 +3623,28 @@ d_local_name (struct d_info *di) static int d_discriminator (struct d_info *di) { - int discrim; + int discrim, num_underscores = 1; if (d_peek_char (di) != '_') return 1; d_advance (di, 1); + if (d_peek_char (di) == '_') + { + ++num_underscores; + d_advance (di, 1); + } + discrim = d_number (di); if (discrim < 0) return 0; + if (num_underscores > 1 && discrim >= 10) + { + if (d_peek_char (di) == '_') + d_advance (di, 1); + else + return 0; + } + return 1; } diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index b65dcd3..c1cfa15 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4666,3 +4666,26 @@ void eat(int*&, Foo()::{lambda(auto:1 _Z3eatIPiZ3BarIsEvvEUlPsPT_PT0_E0_EvRS3_RS5_ void eat()::{lambda(short*, auto:1*, auto:2*)#2}>(int*&, void Bar()::{lambda(short*, auto:1*, auto:2*)#2}&) + +# PR 77489 +_ZZ3foovE8localVar_9 +foo()::localVar + +_ZZ3foovE8localVar_10 +foo()::localVar + +_ZZ3foovE8localVar__10_ +foo()::localVar + +_ZZ3foovE8localVar__9_ +_ZZ3foovE8localVar__9_ + +_ZZ3foovE8localVar__12 +_ZZ3foovE8localVar__12 + +# PR 70182 +_Z1gI1AEv1SIXadsrT_onplEE +void g(S<&A::operator+>) + +_Z1gI1AEv1SIXadsrT_plEE +void g(S<&A::operator+>) -- cgit v1.1