Sync libiberty sources with GCC mainline.
authorNick Clifton <nickc@redhat.com>
Wed, 1 Mar 2017 15:09:29 +0000 (15:09 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 1 Mar 2017 15:09:29 +0000 (15:09 +0000)
Brings in:
  2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>

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  <markus@trippelsdorf.de>

PR c++/77489
* cp-demangle.c (d_discriminator): Handle discriminator >= 10.
* testsuite/demangle-expected: Add tests for discriminator.

 2016-12-13  Jakub Jelinek  <jakub@redhat.com>

PR c++/78761
* cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto).
* testsuite/demangle-expected: Add test for decltype(auto).

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

index de41f89d5e9714f8c05c46c2831b533440caf13c..0c5972a184427c302c0dab3720182b8c54b9e0ab 100644 (file)
@@ -1,6 +1,30 @@
+2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
+
+       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  <markus@trippelsdorf.de>
+
+       PR c++/77489
+       * cp-demangle.c (d_discriminator): Handle discriminator >= 10.
+       * testsuite/demangle-expected: Add tests for discriminator.
+
+2017-01-04  Jakub Jelinek  <jakub@redhat.com>
+
+       Update copyright years.
+
 2017-01-04  Alan Modra  <amodra@gmail.com>
 
-       Sync with gcc.
+       * Makefile.in (configure_deps): Update.
+       * configure: Regenerate.
+
+2016-12-13  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <nathan@acm.org>
 
        is_lambda_arg.
        <DEMANGLE_COMPONENT_LAMBDA>: Increment is_lambda_arg around arg
        printing.
-       * testsuite/demangle-expected: Add lambda auto mangling cases.
-
-2016-12-08  Alan Modra  <amodra@gmail.com>
-
-       * configure: Regenerate.
+       * testsuite/demangle-expected: Add lambda auto mangling cases. 
 
 2016-12-06  DJ Delorie  <dj@redhat.com>
 
        * argv.c (expandargv): Check for directories passed as @-files.
 
+2016-11-30  David Malcolm  <dmalcolm@redhat.com>
+
+       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  <nathan@acm.org>
+
+       * cp-demangle.c (d_print_comp_inner): Fix parameter indentation.
+
 2016-11-03  David Tolnay <dtolnay@gmail.com>
            Mark Wielaard  <mark@klomp.org>
 
        * cplus-dem.c (ada_demangle): Initialize demangled to NULL and
        XDELETEVEC demangled when unknown.
 
-2016-10-17  Nick Clifton  <nickc@redhat.com>
-
-       * Sync with gcc.
-
 2016-09-19  Andrew Stubbs  <ams@codesourcery.com>
 
        * pex-win32.c (argv_to_cmdline): Quote zero-length parameters.
        (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  <nickc@redhat.com>
-
-       Import the following patches from the GCC mainline:
-
-       2015-08-15  Ian Lance Taylor  <iant@google.com>
+2015-08-15  Ian Lance Taylor  <iant@google.com>
 
        * cp-demangle.c (d_abi_tags): Preserve di->last_name across any
        ABI tags.
        * testsuite/d-demangle-expected: Update float and complex literal
        tests to check correct hexadecimal demangling.
 
-2015-07-14  H.J. Lu  <hongjiu.lu@intel.com>
-
-       * configure: Regenerated.
-
 2015-07-13  Mikhail Maltsev  <maltsevm@gmail.com>
 
        * cp-demangle.c (d_dump): Fix syntax error.
        * functions.texi: Regenerate.
 
 2014-12-11  Uros Bizjak  <ubizjak@gmail.com>
-           Ben Elliston  <bje@au.ibm.com>
-           Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+            Ben Elliston  <bje@au.ibm.com>
+            Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
 
        * xvasprintf.c: New file.
        * vprintf-support.h: Likewise.
        (d_ctor_dtor_name): Handle unified ctor/dtor.
 
 2013-11-22  Cary Coutant  <ccoutant@google.com>
-
+    
        PR other/59195
        * cp-demangle.c (struct d_info_checkpoint): New struct.
        (struct d_print_info): Add current_template field.
index 15ef3b48785f0ef49408cabbacb1f1352fbaef9e..f0dbf9381c6becf02c89fc3df0dbd24bb71d7e9b 100644 (file)
@@ -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)
     }
 }
 
-/* <discriminator> ::= _ <(non-negative) number>
+/* <discriminator> ::= _ <number>    # when number < 10
+                   ::= __ <number> _ # when number >= 10
+
+   <discriminator> ::= _ <number>    # 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;
 }
 
index b65dcd3450e9a7de1788b25aeae25fe2ef62a83b..c1cfa1545ecaf8c945211b7d7b4088d9ea05e075 100644 (file)
@@ -4666,3 +4666,26 @@ void eat<int*, Foo()::{lambda(auto:1*, auto:2*)#6}>(int*&, Foo()::{lambda(auto:1
 
 _Z3eatIPiZ3BarIsEvvEUlPsPT_PT0_E0_EvRS3_RS5_
 void eat<int*, void Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}>(int*&, void Bar<short>()::{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<A>(S<&A::operator+>)
+
+_Z1gI1AEv1SIXadsrT_plEE
+void g<A>(S<&A::operator+>)