public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sync libiberty sources with gcc mainline
@ 2022-12-31 12:04 Nick Clifton
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2022-12-31 12:04 UTC (permalink / raw)
  To: bfd-cvs, gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e3a5d5207584e31543d1812f76e288a08b8703ea

commit e3a5d5207584e31543d1812f76e288a08b8703ea
Author: Nick Clifton <nickc@redhat.com>
Date:   Sat Dec 31 12:03:16 2022 +0000

    sync libiberty sources with gcc mainline

Diff:
---
 include/demangle.h                    |  20 ++
 libiberty/ChangeLog                   | 315 +++++++++++++++++++++++---
 libiberty/README                      |   2 +-
 libiberty/_doprnt.c                   |   1 -
 libiberty/configure                   |   7 +-
 libiberty/cp-demangle.c               | 406 +++++++++++++++++++++++++++-------
 libiberty/cp-demangle.h               |   2 +-
 libiberty/functions.texi              |   2 +-
 libiberty/testsuite/demangle-expected |  93 +++++++-
 9 files changed, 737 insertions(+), 111 deletions(-)

diff --git a/include/demangle.h b/include/demangle.h
index e2aa4a971ff..66637ebdc16 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -457,6 +457,17 @@ enum demangle_component_type
   DEMANGLE_COMPONENT_MODULE_PARTITION,
   DEMANGLE_COMPONENT_MODULE_ENTITY,
   DEMANGLE_COMPONENT_MODULE_INIT,
+
+  DEMANGLE_COMPONENT_TEMPLATE_HEAD,
+  DEMANGLE_COMPONENT_TEMPLATE_TYPE_PARM,
+  DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM,
+  DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM,
+  DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM,
+
+  /* A builtin type with argument.  This holds the builtin type
+     information.  */
+  DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE
+
 };
 
 /* Types which are only used internally.  */
@@ -543,6 +554,15 @@ struct demangle_component
       const struct demangle_builtin_type_info *type;
     } s_builtin;
 
+    /* For DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.  */
+    struct
+    {
+      /* Builtin type.  */
+      const struct demangle_builtin_type_info *type;
+      short arg;
+      char suffix;
+    } s_extended_builtin;
+
     /* For DEMANGLE_COMPONENT_SUB_STD.  */
     struct
     {
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 43eae83c229..0e2289d81b7 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,6 +1,271 @@
-2022-07-08  Nick Clifton  <nickc@redhat.com>
+2022-11-23  Marek Polacek  <polacek@redhat.com>
 
-	* 2.39 branch created.
+	Revert:
+	2022-11-23  Marek Polacek  <polacek@redhat.com>
+
+	* configure.ac: Also set shared when enable_host_pie.
+	* configure: Regenerate.
+
+2022-11-23  Marek Polacek  <polacek@redhat.com>
+
+	* configure.ac: Also set shared when enable_host_pie.
+	* configure: Regenerate.
+
+2022-11-15  Nathan Sidwell  <nathan@acm.org>
+
+	* cp-demangle.c (struct d_print_info): Rename is_lambda_arg to
+	lambda_tpl_parms.  Augment semantics.
+	(d_make_comp): Add checks for new components.
+	(d_template_parm, d_template_head): New.
+	(d_lambda): Add templated lambda support.
+	(d_print_init): Adjust.
+	(d_print_lambda_parm_name): New.
+	(d_print_comp_inner): Support templated lambdas,
+	* testsuite/demangle-expected: Add testcases.
+
+2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	* doc/bsd.rst: New file.
+	* doc/conf.py: New file.
+	* doc/copyright.rst: New file.
+	* doc/extensions.rst: New file.
+	* doc/function-variable-and-macro-listing.rst: New file.
+	* doc/index.rst: New file.
+	* doc/indices-and-tables.rst: New file.
+	* doc/introduction.rst: New file.
+	* doc/lesser-general-public-license-2.1.rst: New file.
+	* doc/overview.rst: New file.
+	* doc/replacement-functions.rst: New file.
+	* doc/supplemental-functions.rst: New file.
+	* doc/using.rst: New file.
+
+2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	* Makefile.in: Support Sphinx based documentation.
+
+2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	* at-file.texi: Removed.
+	* copying-lib.texi: Removed.
+	* functions.texi: Removed.
+	* libiberty.texi: Removed.
+	* obstacks.texi: Removed.
+
+2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	* Makefile.in: Support --with-sphinx-build.
+	* configure.ac: Likewise.
+	* configure: Regenerate.
+
+2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	* doc/bsd.rst:
+	Add trailing newline.
+	* doc/copyright.rst:
+	Add trailing newline.
+	* doc/extensions.rst:
+	Add trailing newline.
+	* doc/function-variable-and-macro-listing.rst:
+	Add trailing newline.
+	* doc/index.rst:
+	Add trailing newline.
+	* doc/indices-and-tables.rst:
+	Add trailing newline.
+	* doc/introduction.rst:
+	Add trailing newline.
+	* doc/lesser-general-public-license-2.1.rst:
+	Add trailing newline.
+	* doc/overview.rst:
+	Add trailing newline.
+	* doc/replacement-functions.rst:
+	Add trailing newline.
+	* doc/supplemental-functions.rst:
+	Add trailing newline.
+	* doc/using.rst:
+	Add trailing newline.
+
+2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	* doc/conf.py: Add newline at last line.
+
+2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2022-11-14  Martin Liska  <mliska@suse.cz>
+
+	PR other/107620
+	* configure: Regenerate.
+	* configure.ac: Always set sphinx-build.
+
+2022-11-13  Martin Liska  <mliska@suse.cz>
+
+	PR other/107620
+	* configure: Regenerate.
+	* configure.ac: Always set sphinx-build.
+
+2022-11-10  Martin Liska  <mliska@suse.cz>
+
+	* doc/conf.py: Add newline at last line.
+
+2022-11-09  Martin Liska  <mliska@suse.cz>
+
+	* doc/bsd.rst:
+	Add trailing newline.
+	* doc/copyright.rst:
+	Add trailing newline.
+	* doc/extensions.rst:
+	Add trailing newline.
+	* doc/function-variable-and-macro-listing.rst:
+	Add trailing newline.
+	* doc/index.rst:
+	Add trailing newline.
+	* doc/indices-and-tables.rst:
+	Add trailing newline.
+	* doc/introduction.rst:
+	Add trailing newline.
+	* doc/lesser-general-public-license-2.1.rst:
+	Add trailing newline.
+	* doc/overview.rst:
+	Add trailing newline.
+	* doc/replacement-functions.rst:
+	Add trailing newline.
+	* doc/supplemental-functions.rst:
+	Add trailing newline.
+	* doc/using.rst:
+	Add trailing newline.
+
+2022-11-09  Martin Liska  <mliska@suse.cz>
+
+	* Makefile.in: Support --with-sphinx-build.
+	* configure.ac: Likewise.
+	* configure: Regenerate.
+
+2022-11-09  Martin Liska  <mliska@suse.cz>
+
+	* at-file.texi: Removed.
+	* copying-lib.texi: Removed.
+	* functions.texi: Removed.
+	* libiberty.texi: Removed.
+	* obstacks.texi: Removed.
+
+2022-11-09  Martin Liska  <mliska@suse.cz>
+
+	* Makefile.in: Support Sphinx based documentation.
+
+2022-11-09  Martin Liska  <mliska@suse.cz>
+
+	* doc/bsd.rst: New file.
+	* doc/conf.py: New file.
+	* doc/copyright.rst: New file.
+	* doc/extensions.rst: New file.
+	* doc/function-variable-and-macro-listing.rst: New file.
+	* doc/index.rst: New file.
+	* doc/indices-and-tables.rst: New file.
+	* doc/introduction.rst: New file.
+	* doc/lesser-general-public-license-2.1.rst: New file.
+	* doc/overview.rst: New file.
+	* doc/replacement-functions.rst: New file.
+	* doc/supplemental-functions.rst: New file.
+	* doc/using.rst: New file.
+
+2022-10-18  Florian Weimer  <fweimer@redhat.com>
+
+	* acinclude.m4 (ac_cv_func_strncmp_works): Add missing
+	int return type and parameter list to the definition of main.
+	Include <stdlib.h> and <string.h> for prototypes.
+	(ac_cv_c_stack_direction): Add missing
+	int return type and parameter list to the definitions of
+	main, find_stack_direction.  Include <stdlib.h> for exit
+	prototype.
+	* configure: Regenerate.
+
+2022-10-14  Jakub Jelinek  <jakub@redhat.com>
+
+	* cp-demangle.h (D_BUILTIN_TYPE_COUNT): Increment.
+	* cp-demangle.c (cplus_demangle_builtin_types): Add std::bfloat16_t
+	entry.
+	(cplus_demangle_type): Demangle DF16b.
+	* testsuite/demangle-expected (_Z3xxxDF16b): New test.
+
+2022-10-11  Nathan Sidwell  <nathan@acm.org>
+
+	* cp-demangle.c (d_prefix): 'M' components are not
+	(re-)added to the substitution table.
+	* testsuite/demangle-expected: Add tests.
+
+2022-10-07  Nathan Sidwell  <nathan@acm.org>
+
+	* cp-demangle.c (d_print_comp_inner): Allow parameter packs
+	in a lambda signature.
+	* testsuite/demangle-expected: Add tests.
+
+2022-09-27  Jakub Jelinek  <jakub@redhat.com>
+
+	PR c++/106652
+	PR c++/85518
+	* cp-demangle.c (d_dump): Handle
+	DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.  Don't handle
+	DEMANGLE_COMPONENT_FIXED_TYPE.
+	(d_make_extended_builtin_type): New function.
+	(cplus_demangle_builtin_types): Add _Float entry.
+	(cplus_demangle_type): For DF demangle it as _Float<N> or
+	_Float<N>x rather than fixed point which conflicts with it.
+	(d_count_templates_scopes): Handle
+	DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.  Just break; for
+	DEMANGLE_COMPONENT_FIXED_TYPE.
+	(d_find_pack): Handle DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE.
+	Don't handle DEMANGLE_COMPONENT_FIXED_TYPE.
+	(d_print_comp_inner): Likewise.
+	* cp-demangle.h (D_BUILTIN_TYPE_COUNT): Bump.
+	* testsuite/demangle-expected: Replace _Z3xxxDFyuVb test
+	with _Z3xxxDF16_DF32_DF64_DF128_CDF16_Vb.  Add
+	_Z3xxxDF32xDF64xDF128xCDF32xVb test.
+
+2022-09-22  Jonathan Wakely  <jwakely@redhat.com>
+
+	* README: Replace gcc-bugs email address with Bugzilla URL.
+
+2022-08-25  Martin Liska  <mliska@suse.cz>
+
+	* configure: Regenerate.
+
+2022-07-22  Martin Liska  <mliska@suse.cz>
+
+	PR other/106370
+	* _doprnt.c: Remove continue as last stmt
+	in a loop.
+
+2022-07-14  Martin Liska  <mliska@suse.cz>
+
+	* functions.texi: Replace strtoul with strtoull.
+
+2022-07-04  Nick Clifton  <nickc@redhat.com>
+
+	* rust-demangle.c (demangle_const): Add a missing goto pass_return
+	at the end of the function.
+
+2022-07-04  Nick Clifton  <nickc@redhat.com>
+
+	* rust-demangle.c (demangle_path_maybe_open_generics): Add
+	recursion limit.
 
 2022-07-01  Nick Clifton  <nickc@redhat.com>
 
@@ -1488,7 +1753,7 @@
 2016-06-12  Brooks Moses  <bmoses@google.com>
 
 	* cp-demangle.c (cplus_demangle_print_callback): Avoid zero-length
-	  VLAs.
+	VLAs.
 
 2016-05-31  Alan Modra  <amodra@gmail.com>
 
@@ -3065,8 +3330,8 @@
 
 2009-08-23  H.J. Lu  <hongjiu.lu@intel.com>
 
-	 PR ld/10536
-	 * Makefile.in (install-html-recursive): Removed.
+	PR ld/10536
+	* Makefile.in (install-html-recursive): Removed.
 
 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
@@ -7500,7 +7765,7 @@ Sun Nov 28 00:59:39 1999  Philippe De Muyter  <phdm@macqel.be>
 	* strtoul.c, strtol.c, random.c: Remove advertising clause from
 	BSD license, pursuant with
 
-	  ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+	ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
 
 Wed Nov 10 09:42:39 1999  Jeffrey A Law  (law@cygnus.com)
 
@@ -9884,12 +10149,12 @@ Sun Feb 27 21:50:11 1994  Jim Kingdon  (kingdon@deneb.cygnus.com)
 Thu Feb 24 11:51:12 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
 
 	* getopt.c: Remove #ifdef GETOPT_COMPAT and #if 0 code.
-	 (_getopt_initialize): New function, broken out of _getopt_internal.
-	 (_getopt_internal):
-	 If long_only and the ARGV-element has the form "-f", where f is
-	 a valid short option, don't consider it an abbreviated form of
-	 a long option that starts with f.  Otherwise there would be no
-	 way to give the -f short option.
+	(_getopt_initialize): New function, broken out of _getopt_internal.
+	(_getopt_internal):
+	If long_only and the ARGV-element has the form "-f", where f is
+	a valid short option, don't consider it an abbreviated form of
+	a long option that starts with f.  Otherwise there would be no
+	way to give the -f short option.
 
 Thu Feb 10 14:44:16 1994  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
@@ -10109,8 +10374,8 @@ Fri Oct 22 07:53:15 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 Tue Oct 19 17:12:01 1993  david d `zoo' zuhn  (zoo@rtl.cygnus.com)
 
 	* Makefile.in (lneeded-list): ensure that object file names are
-	  not duplicated, as multiple instances of the same object file in
-	  a library causes problems on some machines
+	not duplicated, as multiple instances of the same object file in
+	a library causes problems on some machines
 
 Mon Oct 18 21:59:28 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
@@ -10523,10 +10788,10 @@ Wed Sep  9 12:41:48 1992  Ian Lance Taylor  (ian@cygnus.com)
 Thu Sep  3 13:29:39 1992  K. Richard Pixley  (rich@sendai.cygnus.com)
 
 	* cplus-dem.c: (demangle_prefix): reduction in strength of strstr
-	  as a time optimization.
+	as a time optimization.
 
 	* cplus-dem.c (cplus_demangle): remove strpbrk test.  Appears to
-	  be more expensive than simply demangling.
+	be more expensive than simply demangling.
 
 	* cplus-dem.c (cplus_match): new function.
 
@@ -10622,7 +10887,7 @@ Wed Jun 17 18:13:58 1992  Per Bothner  (bothner@rtl.cygnus.com)
 Tue Jun 16 16:11:59 1992  K. Richard Pixley  (rich@rtl.cygnus.com)
 
 	* getopt.c, getopt1.c: merged largely gratuitous, mostly
-	  whitespace diffs from other prep distributions.
+	whitespace diffs from other prep distributions.
 
 Mon Jun 15 12:25:46 1992  Fred Fish  (fnf@cygnus.com)
 
@@ -10712,7 +10977,7 @@ Mon Apr 20 20:49:32 1992  K. Richard Pixley  (rich@cygnus.com)
 	* Makefile.in: do not print recursion line.
 
 	* Makefile.in: allow CFLAGS to be passed in from command line.
-	  Removed MINUS_G.  Default CFLAGS to -g.
+	Removed MINUS_G.  Default CFLAGS to -g.
 
 Mon Apr 20 12:57:46 1992  Per Bothner  (bothner@rtl.cygnus.com)
 
@@ -10783,8 +11048,8 @@ Thu Feb 27 22:19:39 1992  Per Bothner  (bothner@cygnus.com)
 Wed Feb 26 18:04:40 1992  K. Richard Pixley  (rich@cygnus.com)
 
 	* Makefile.in, configure.in: removed traces of namesubdir,
-	  -subdirs, $(subdir), $(unsubdir), some rcs triggers.  Forced
-	  copyrights to '92, changed some from Cygnus to FSF.
+	-subdirs, $(subdir), $(unsubdir), some rcs triggers.  Forced
+	copyrights to '92, changed some from Cygnus to FSF.
 
 Sat Feb 22 01:09:21 1992  Stu Grossman  (grossman at cygnus.com)
 
@@ -10869,17 +11134,17 @@ Tue Dec 10 04:14:49 1991  K. Richard Pixley  (rich at rtl.cygnus.com)
 Fri Dec  6 23:26:45 1991  K. Richard Pixley  (rich at rtl.cygnus.com)
 
 	* Makefile.in: remove spaces following hyphens because bsd make
-	  can't cope.  added standards.text support.  install using
-	  INSTALL_DATA.
+	can't cope.  added standards.text support.  install using
+	INSTALL_DATA.
 
 	* configure.in: remove commontargets as it is no longer a
-	  recognized hook.
+	recognized hook.
 
 Thu Dec  5 22:46:46 1991  K. Richard Pixley  (rich at rtl.cygnus.com)
 
 	* Makefile.in: idestdir and ddestdir go away.  Added copyrights
-	  and shift gpl to v2.  Added ChangeLog if it didn't exist. docdir
-	  and mandir now keyed off datadir by default.
+	and shift gpl to v2.  Added ChangeLog if it didn't exist. docdir
+	and mandir now keyed off datadir by default.
 
 Fri Nov 22 19:15:29 1991  John Gilmore  (gnu at cygnus.com)
 
diff --git a/libiberty/README b/libiberty/README
index 9f1cc979e49..e7ffb17c192 100644
--- a/libiberty/README
+++ b/libiberty/README
@@ -15,7 +15,7 @@ The library must be configured from the top source directory.  Don't
 try to run configure in this directory.  Follow the configuration
 instructions in ../README.
 
-Please report bugs to "gcc-bugs@gcc.gnu.org" and send fixes to
+Please report bugs to https://gcc.gnu.org/bugzilla/ and send fixes to
 "gcc-patches@gcc.gnu.org".  Thank you.
 
 ADDING A NEW FILE
diff --git a/libiberty/_doprnt.c b/libiberty/_doprnt.c
index cebaa16056b..c7232d858c6 100644
--- a/libiberty/_doprnt.c
+++ b/libiberty/_doprnt.c
@@ -55,7 +55,6 @@ Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 	 putc(CHAR, stream); \
 	 ptr++; \
 	 total_printed++; \
-	 continue; \
      } while (0)
 
 #define PRINT_TYPE(TYPE) \
diff --git a/libiberty/configure b/libiberty/configure
index 451af4978e7..79ef15312e2 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5349,6 +5349,9 @@ case "${host}" in
 	# sets the default TLS model and affects inlining.
 	PICFLAG=-fPIC
 	;;
+    loongarch*-*-*)
+	PICFLAG=-fpic
+	;;
     mips-sgi-irix6*)
 	# PIC is the default.
 	;;
@@ -5365,7 +5368,9 @@ case "${host}" in
     sh-*-linux* | sh[2346lbe]*-*-linux*)
 	PICFLAG=-fpic
 	;;
-    sh*-*-netbsd*)
+    # FIXME: Simplify to sh*-*-netbsd*?
+    sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+      sh64-*-netbsd* | sh64l*-*-netbsd*)
 	PICFLAG=-fpic
 	;;
     # Default to -fPIC unless specified otherwise.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index d06d80d1fee..ad533f6085e 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -347,9 +347,9 @@ struct d_print_info
   /* Number of times d_print_comp was recursively called.  Should not
      be bigger than MAX_RECURSION_COUNT.  */
   int recursion;
-  /* Non-zero if we're printing a lambda argument.  A template
-     parameter reference actually means 'auto'.  */
-  int is_lambda_arg;
+  /* 1 more than the number of explicit template parms of a lambda.  Template
+     parm references >= are actually 'auto'.  */
+  int lambda_tpl_parms;
   /* The current index into any template argument packs we are using
      for printing, or -1 to print the whole pack.  */
   int pack_index;
@@ -491,6 +491,10 @@ static struct demangle_component *d_local_name (struct d_info *);
 
 static int d_discriminator (struct d_info *);
 
+static struct demangle_component *d_template_parm (struct d_info *, int *bad);
+
+static struct demangle_component *d_template_head (struct d_info *, int *bad);
+
 static struct demangle_component *d_lambda (struct d_info *);
 
 static struct demangle_component *d_unnamed_type (struct d_info *);
@@ -648,6 +652,13 @@ d_dump (struct demangle_component *dc, int indent)
     case DEMANGLE_COMPONENT_BUILTIN_TYPE:
       printf ("builtin type %s\n", dc->u.s_builtin.type->name);
       return;
+    case DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE:
+      {
+	char suffix[2] = { dc->u.s_extended_builtin.type->suffix, 0 };
+	printf ("builtin type %s%d%s\n", dc->u.s_extended_builtin.type->name,
+		dc->u.s_extended_builtin.type->arg, suffix);
+      }
+      return;
     case DEMANGLE_COMPONENT_OPERATOR:
       printf ("operator %s\n", dc->u.s_operator.op->name);
       return;
@@ -771,11 +782,6 @@ d_dump (struct demangle_component *dc, int indent)
     case DEMANGLE_COMPONENT_PTRMEM_TYPE:
       printf ("pointer to member type\n");
       break;
-    case DEMANGLE_COMPONENT_FIXED_TYPE:
-      printf ("fixed-point type, accum? %d, sat? %d\n",
-              dc->u.s_fixed.accum, dc->u.s_fixed.sat);
-      d_dump (dc->u.s_fixed.length, indent + 2);
-      break;
     case DEMANGLE_COMPONENT_ARGLIST:
       printf ("argument list\n");
       break;
@@ -1026,6 +1032,10 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
     case DEMANGLE_COMPONENT_TPARM_OBJ:
     case DEMANGLE_COMPONENT_STRUCTURED_BINDING:
     case DEMANGLE_COMPONENT_MODULE_INIT:
+    case DEMANGLE_COMPONENT_TEMPLATE_HEAD:
+    case DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM:
+    case DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM:
+    case DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM:
       if (left == NULL)
 	return NULL;
       break;
@@ -1048,6 +1058,7 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
     case DEMANGLE_COMPONENT_CONST:
     case DEMANGLE_COMPONENT_ARGLIST:
     case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
+    case DEMANGLE_COMPONENT_TEMPLATE_TYPE_PARM:
     FNQUAL_COMPONENT_CASE:
       break;
 
@@ -1109,6 +1120,28 @@ d_make_builtin_type (struct d_info *di,
   return p;
 }
 
+/* Add a new extended builtin type component.  */
+
+static struct demangle_component *
+d_make_extended_builtin_type (struct d_info *di,
+			      const struct demangle_builtin_type_info *type,
+			      short arg, char suffix)
+{
+  struct demangle_component *p;
+
+  if (type == NULL)
+    return NULL;
+  p = d_make_empty (di);
+  if (p != NULL)
+    {
+      p->type = DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE;
+      p->u.s_extended_builtin.type = type;
+      p->u.s_extended_builtin.arg = arg;
+      p->u.s_extended_builtin.suffix = suffix;
+    }
+  return p;
+}
+
 /* Add a new operator component.  */
 
 static struct demangle_component *
@@ -1585,12 +1618,10 @@ d_prefix (struct d_info *di, int substable)
 	}
       else if (peek == 'M')
 	{
-	  /* Initializer scope for a lambda.  We don't need to represent
-	     this; the normal code will just treat the variable as a type
-	     scope, which gives appropriate output.  */
-	  if (ret == NULL)
-	    return NULL;
+	  /* Initializer scope for a lambda.  We already added it as a
+  	     substitution candidate, don't do that again.  */
 	  d_advance (di, 1);
+	  continue;
 	}
       else
 	{
@@ -2464,6 +2495,8 @@ cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] =
   /* 32 */ { NL ("char32_t"),	NL ("char32_t"),	D_PRINT_DEFAULT },
   /* 33 */ { NL ("decltype(nullptr)"),	NL ("decltype(nullptr)"),
 	     D_PRINT_DEFAULT },
+  /* 34 */ { NL ("_Float"),	NL ("_Float"),		D_PRINT_FLOAT },
+  /* 35 */ { NL ("std::bfloat16_t"), NL ("std::bfloat16_t"), D_PRINT_FLOAT },
 };
 
 CP_STATIC_IF_GLIBCPP_V3
@@ -2727,19 +2760,37 @@ cplus_demangle_type (struct d_info *di)
 	  break;
 
 	case 'F':
-	  /* Fixed point types. DF<int bits><length><fract bits><sat>  */
-	  ret = d_make_empty (di);
-	  ret->type = DEMANGLE_COMPONENT_FIXED_TYPE;
-	  if ((ret->u.s_fixed.accum = IS_DIGIT (d_peek_char (di))))
-	    /* For demangling we don't care about the bits.  */
-	    d_number (di);
-	  ret->u.s_fixed.length = cplus_demangle_type (di);
-	  if (ret->u.s_fixed.length == NULL)
-	    return NULL;
-	  d_number (di);
-	  peek = d_next_char (di);
-	  ret->u.s_fixed.sat = (peek == 's');
-	  break;
+	  /* DF<number>_ - _Float<number>.
+	     DF<number>x - _Float<number>x
+	     DF16b - std::bfloat16_t.  */
+	  {
+	    int arg = d_number (di);
+	    char buf[12];
+	    char suffix = 0;
+	    if (d_peek_char (di) == 'b')
+	      {
+		if (arg != 16)
+		  return NULL;
+		d_advance (di, 1);
+		ret = d_make_builtin_type (di,
+					   &cplus_demangle_builtin_types[35]);
+		di->expansion += ret->u.s_builtin.type->len;
+		break;
+	      }
+	    if (d_peek_char (di) == 'x')
+	      suffix = 'x';
+	    if (!suffix && d_peek_char (di) != '_')
+	      return NULL;
+	    ret
+	      = d_make_extended_builtin_type (di,
+					      &cplus_demangle_builtin_types[34],
+					      arg, suffix);
+	    d_advance (di, 1);
+	    sprintf (buf, "%d", arg);
+	    di->expansion += ret->u.s_extended_builtin.type->len
+			     + strlen (buf) + (suffix != 0);
+	    break;
+	  }
 
 	case 'v':
 	  ret = d_vector_type (di);
@@ -3835,32 +3886,120 @@ d_discriminator (struct d_info *di)
   return 1;
 }
 
-/* <closure-type-name> ::= Ul <lambda-sig> E [ <nonnegative number> ] _ */
+/* <template-parm> ::= Ty
+                   ::= Tn <type>
+		   ::= Tt <template-head> E
+		   ::= Tp <template-parm>  */
 
 static struct demangle_component *
-d_lambda (struct d_info *di)
+d_template_parm (struct d_info *di, int *bad)
 {
-  struct demangle_component *tl;
-  struct demangle_component *ret;
-  int num;
+  if (d_peek_char (di) != 'T')
+    return NULL;
 
+  struct demangle_component *op;
+  enum demangle_component_type kind;
+  switch (d_peek_next_char (di))
+    {
+    default:
+      return NULL;
+
+    case 'p': /* Pack  */
+      d_advance (di, 2);
+      op = d_template_parm (di, bad);
+      kind = DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM;
+      if (!op)
+	{
+	  *bad = 1;
+	  return NULL;
+	}
+      break;
+
+    case 'y': /* Typename  */
+      d_advance (di, 2);
+      op = NULL;
+      kind = DEMANGLE_COMPONENT_TEMPLATE_TYPE_PARM;
+      break;
+
+    case 'n': /* Non-Type  */
+      d_advance (di, 2);
+      op = cplus_demangle_type (di);
+      kind = DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM;
+      if (!op)
+	{
+	  *bad = 1;
+	  return NULL;
+	}
+      break;
+
+    case 't': /* Template */
+      d_advance (di, 2);
+      op = d_template_head (di, bad);
+      kind = DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM;
+      if (!op || !d_check_char (di, 'E'))
+	{
+	  *bad = 1;
+	  return NULL;
+	}
+    }
+
+  return d_make_comp (di, kind, op, NULL);
+}
+
+/* <template-head> ::= <template-head>? <template-parm>  */
+
+static struct demangle_component *
+d_template_head (struct d_info *di, int *bad)
+{
+  struct demangle_component *res = NULL, **slot = &res;
+  struct demangle_component *op;
+
+  while ((op = d_template_parm (di, bad)))
+    {
+      *slot = op;
+      slot = &d_right (op);
+    }
+
+  /* Wrap it in a template head, to make concatenating with any parm list, and
+     printing simpler.  */
+  if (res)
+    res = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE_HEAD, res, NULL);
+
+  return res;
+}
+
+/* <closure-type-name> ::= Ul <template-head>? <lambda-sig> E [ <nonnegative number> ] _ */
+
+static struct demangle_component *
+d_lambda (struct d_info *di)
+{
   if (! d_check_char (di, 'U'))
     return NULL;
   if (! d_check_char (di, 'l'))
     return NULL;
 
-  tl = d_parmlist (di);
+  int bad = 0;
+  struct demangle_component *head = d_template_head (di, &bad);
+  if (bad)
+    return NULL;
+
+  struct demangle_component *tl = d_parmlist (di);
   if (tl == NULL)
     return NULL;
+  if (head)
+    {
+      d_right (head) = tl;
+      tl = head;
+    }
 
   if (! d_check_char (di, 'E'))
     return NULL;
 
-  num = d_compact_number (di);
+  int num = d_compact_number (di);
   if (num < 0)
     return NULL;
 
-  ret = d_make_empty (di);
+  struct demangle_component *ret = d_make_empty (di);
   if (ret)
     {
       ret->type = DEMANGLE_COMPONENT_LAMBDA;
@@ -4202,6 +4341,7 @@ d_count_templates_scopes (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_FUNCTION_PARAM:
     case DEMANGLE_COMPONENT_SUB_STD:
     case DEMANGLE_COMPONENT_BUILTIN_TYPE:
+    case DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE:
     case DEMANGLE_COMPONENT_OPERATOR:
     case DEMANGLE_COMPONENT_CHARACTER:
     case DEMANGLE_COMPONENT_NUMBER:
@@ -4210,6 +4350,12 @@ d_count_templates_scopes (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_MODULE_NAME:
     case DEMANGLE_COMPONENT_MODULE_PARTITION:
     case DEMANGLE_COMPONENT_MODULE_INIT:
+    case DEMANGLE_COMPONENT_FIXED_TYPE:
+    case DEMANGLE_COMPONENT_TEMPLATE_HEAD:
+    case DEMANGLE_COMPONENT_TEMPLATE_TYPE_PARM:
+    case DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM:
+    case DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM:
+    case DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM:
       break;
 
     case DEMANGLE_COMPONENT_TEMPLATE:
@@ -4309,10 +4455,6 @@ d_count_templates_scopes (struct d_print_info *dpi,
       d_count_templates_scopes (dpi, dc->u.s_extended_operator.name);
       break;
 
-    case DEMANGLE_COMPONENT_FIXED_TYPE:
-      d_count_templates_scopes (dpi, dc->u.s_fixed.length);
-      break;
-
     case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS:
     case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS:
     case DEMANGLE_COMPONENT_MODULE_ENTITY:
@@ -4344,7 +4486,7 @@ d_print_init (struct d_print_info *dpi, demangle_callbackref callback,
 
   dpi->demangle_failure = 0;
   dpi->recursion = 0;
-  dpi->is_lambda_arg = 0;
+  dpi->lambda_tpl_parms = 0;
 
   dpi->component_stack = NULL;
 
@@ -4580,11 +4722,11 @@ d_find_pack (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_TAGGED_NAME:
     case DEMANGLE_COMPONENT_OPERATOR:
     case DEMANGLE_COMPONENT_BUILTIN_TYPE:
+    case DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE:
     case DEMANGLE_COMPONENT_SUB_STD:
     case DEMANGLE_COMPONENT_CHARACTER:
     case DEMANGLE_COMPONENT_FUNCTION_PARAM:
     case DEMANGLE_COMPONENT_UNNAMED_TYPE:
-    case DEMANGLE_COMPONENT_FIXED_TYPE:
     case DEMANGLE_COMPONENT_DEFAULT_ARG:
     case DEMANGLE_COMPONENT_NUMBER:
       return NULL;
@@ -4841,6 +4983,33 @@ d_maybe_print_designated_init (struct d_print_info *dpi, int options,
   return 1;
 }
 
+static void
+d_print_lambda_parm_name (struct d_print_info *dpi, int type, unsigned index)
+{
+  const char *str;
+  switch (type)
+    {
+    default:
+      dpi->demangle_failure = 1;
+      str = "";
+      break;
+
+    case DEMANGLE_COMPONENT_TEMPLATE_TYPE_PARM:
+      str = "$T";
+      break;
+
+    case DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM:
+      str = "$N";
+      break;
+
+    case DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM:
+      str = "$TT";
+      break;
+    }
+  d_append_string (dpi, str);
+  d_append_num (dpi, index);
+}
+
 /* Subroutine to handle components.  */
 
 static void
@@ -5095,7 +5264,21 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
       }
 
     case DEMANGLE_COMPONENT_TEMPLATE_PARAM:
-      if (dpi->is_lambda_arg)
+      if (dpi->lambda_tpl_parms > dc->u.s_number.number + 1)
+	{
+	  const struct demangle_component *a
+	    = d_left (dpi->templates->template_decl);
+	  unsigned c;
+	  for (c = dc->u.s_number.number; a && c; c--)
+	    a = d_right (a);
+	  if (a && a->type == DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM)
+	    a = d_left (a);
+	  if (!a)
+	    dpi->demangle_failure = 1;
+	  else
+	    d_print_lambda_parm_name (dpi, a->type, dc->u.s_number.number);
+	}
+      else if (dpi->lambda_tpl_parms)
 	{
 	  /* Show the template parm index, as that's how g++ displays
 	     these, and future proofs us against potential
@@ -5276,7 +5459,7 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
       {
 	/* Handle reference smashing: & + && = &.  */
 	struct demangle_component *sub = d_left (dc);
-	if (!dpi->is_lambda_arg
+	if (!dpi->lambda_tpl_parms
 	    && sub->type == DEMANGLE_COMPONENT_TEMPLATE_PARAM)
 	  {
 	    struct d_saved_scope *scope = d_get_saved_scope (dpi, sub);
@@ -5387,6 +5570,14 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
 			 dc->u.s_builtin.type->java_len);
       return;
 
+    case DEMANGLE_COMPONENT_EXTENDED_BUILTIN_TYPE:
+      d_append_buffer (dpi, dc->u.s_extended_builtin.type->name,
+		       dc->u.s_extended_builtin.type->len);
+      d_append_num (dpi, dc->u.s_extended_builtin.arg);
+      if (dc->u.s_extended_builtin.suffix)
+	d_append_buffer (dpi, &dc->u.s_extended_builtin.suffix, 1);
+      return;
+
     case DEMANGLE_COMPONENT_VENDOR_TYPE:
       d_print_comp (dpi, options, d_left (dc));
       return;
@@ -5525,22 +5716,6 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
 	return;
       }
 
-    case DEMANGLE_COMPONENT_FIXED_TYPE:
-      if (dc->u.s_fixed.sat)
-	d_append_string (dpi, "_Sat ");
-      /* Don't print "int _Accum".  */
-      if (dc->u.s_fixed.length->u.s_builtin.type
-	  != &cplus_demangle_builtin_types['i'-'a'])
-	{
-	  d_print_comp (dpi, options, dc->u.s_fixed.length);
-	  d_append_char (dpi, ' ');
-	}
-      if (dc->u.s_fixed.accum)
-	d_append_string (dpi, "_Accum");
-      else
-	d_append_string (dpi, "_Fract");
-      return;
-
     case DEMANGLE_COMPONENT_ARGLIST:
     case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
       if (d_left (dc) != NULL)
@@ -5908,9 +6083,10 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
 
     case DEMANGLE_COMPONENT_PACK_EXPANSION:
       {
-	int len;
-	int i;
-	struct demangle_component *a = d_find_pack (dpi, d_left (dc));
+	struct demangle_component *a = NULL;
+
+	if (!dpi->lambda_tpl_parms)
+	  a = d_find_pack (dpi, d_left (dc));
 	if (a == NULL)
 	  {
 	    /* d_find_pack won't find anything if the only packs involved
@@ -5918,17 +6094,20 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
 	       case, just print the pattern and "...".  */
 	    d_print_subexpr (dpi, options, d_left (dc));
 	    d_append_string (dpi, "...");
-	    return;
 	  }
-
-	len = d_pack_length (a);
-	dc = d_left (dc);
-	for (i = 0; i < len; ++i)
+	else
 	  {
-	    dpi->pack_index = i;
-	    d_print_comp (dpi, options, dc);
-	    if (i < len-1)
-	      d_append_string (dpi, ", ");
+	    int len = d_pack_length (a);
+	    int i;
+
+	    dc = d_left (dc);
+	    for (i = 0; i < len; ++i)
+	      {
+		if (i)
+		  d_append_string (dpi, ", ");
+		dpi->pack_index = i;
+		d_print_comp (dpi, options, dc);
+	      }
 	  }
       }
       return;
@@ -5958,15 +6137,50 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
       return;
 
     case DEMANGLE_COMPONENT_LAMBDA:
-      d_append_string (dpi, "{lambda(");
-      /* Generic lambda auto parms are mangled as the template type
-	 parm they are.  */
-      dpi->is_lambda_arg++;
-      d_print_comp (dpi, options, dc->u.s_unary_num.sub);
-      dpi->is_lambda_arg--;
-      d_append_string (dpi, ")#");
-      d_append_num (dpi, dc->u.s_unary_num.num + 1);
-      d_append_char (dpi, '}');
+      {
+	d_append_string (dpi, "{lambda");
+	struct demangle_component *parms = dc->u.s_unary_num.sub;
+	struct d_print_template dpt;
+	/* Generic lambda auto parms are mangled as the (synthedic) template
+	   type parm they are.  We need to tell the printer that (a) we're in
+	   a lambda, and (b) the number of synthetic parms.  */
+	int saved_tpl_parms = dpi->lambda_tpl_parms;
+	dpi->lambda_tpl_parms = 0;
+	/* Hang any lambda head as-if template args.  */
+	dpt.template_decl = NULL;
+	dpt.next = dpi->templates;
+	dpi->templates = &dpt;
+	if (parms && parms->type == DEMANGLE_COMPONENT_TEMPLATE_HEAD)
+	  {
+	    dpt.template_decl = parms;
+
+	    d_append_char (dpi, '<');
+	    struct demangle_component *parm;
+	    for (parm = d_left (parms); parm; parm = d_right (parm))
+	      {
+		if (dpi->lambda_tpl_parms++)
+		  d_append_string (dpi, ", ");
+		d_print_comp (dpi, options, parm);
+		d_append_char (dpi, ' ');
+		if (parm->type == DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM)
+		  parm = d_left (parm);
+		d_print_lambda_parm_name (dpi, parm->type,
+					  dpi->lambda_tpl_parms - 1);
+	      }
+	    d_append_char (dpi, '>');
+
+	    parms = d_right (parms);
+	  }
+	dpi->lambda_tpl_parms++;
+
+	d_append_char (dpi, '(');
+	d_print_comp (dpi, options, parms);
+	dpi->lambda_tpl_parms = saved_tpl_parms;
+	dpi->templates = dpt.next;
+	d_append_string (dpi, ")#");
+	d_append_num (dpi, dc->u.s_unary_num.num + 1);
+	d_append_char (dpi, '}');
+      }
       return;
 
     case DEMANGLE_COMPONENT_UNNAMED_TYPE:
@@ -5982,6 +6196,40 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
       d_append_char (dpi, ']');
       return;
 
+    case DEMANGLE_COMPONENT_TEMPLATE_HEAD:
+      {
+	d_append_char (dpi, '<');
+	int count = 0;
+	struct demangle_component *parm;
+	for (parm = d_left (dc); parm; parm = d_right (parm))
+	  {
+	    if (count++)
+	      d_append_string (dpi, ", ");
+	    d_print_comp (dpi, options, parm);
+	  }
+	d_append_char (dpi, '>');
+      }
+      return;
+
+    case DEMANGLE_COMPONENT_TEMPLATE_TYPE_PARM:
+      d_append_string (dpi, "typename");
+      return;
+
+    case DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM:
+      d_print_comp (dpi, options, d_left (dc));
+      return;
+
+    case DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM:
+      d_append_string (dpi, "template");
+      d_print_comp (dpi, options, d_left (dc));
+      d_append_string (dpi, " class");
+      return;
+
+    case DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM:
+      d_print_comp (dpi, options, d_left (dc));
+      d_append_string (dpi, "...");
+      return;
+
     default:
       d_print_error (dpi);
       return;
diff --git a/libiberty/cp-demangle.h b/libiberty/cp-demangle.h
index c6445036d67..7f710be4a01 100644
--- a/libiberty/cp-demangle.h
+++ b/libiberty/cp-demangle.h
@@ -180,7 +180,7 @@ d_advance (struct d_info *di, int i)
 extern const struct demangle_operator_info cplus_demangle_operators[];
 #endif
 
-#define D_BUILTIN_TYPE_COUNT (34)
+#define D_BUILTIN_TYPE_COUNT (36)
 
 CP_STATIC_IF_GLIBCPP_V3
 const struct demangle_builtin_type_info
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index e4d74b58220..b56b02e0686 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -1747,7 +1747,7 @@ that the converted value is unsigned.
 @c strtoll.c:33
 @deftypefn Supplemental {long long int} strtoll (const char *@var{string}, @
   char **@var{endptr}, int @var{base})
-@deftypefnx Supplemental {unsigned long long int} strtoul (@
+@deftypefnx Supplemental {unsigned long long int} strtoull (@
   const char *@var{string}, char **@var{endptr}, int @var{base})
 
 The @code{strtoll} function converts the string in @var{string} to a
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 351af349219..d9bc7ed4b1f 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -1242,8 +1242,16 @@ _ZNSt9_Any_data9_M_accessIPZ4postISt8functionIFvvEEEvOT_EUlvE_EERS5_v
 post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std::_Any_data::_M_access<post<std::function<void ()> >(post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
 #
 --format=auto --no-params
-_Z3xxxDFyuVb
-xxx(unsigned long long _Fract, bool volatile)
+_Z3xxxDF16_DF32_DF64_DF128_CDF16_Vb
+xxx(_Float16, _Float32, _Float64, _Float128, _Float16 _Complex, bool volatile)
+xxx
+--format=auto --no-params
+_Z3xxxDF32xDF64xDF128xCDF32xVb
+xxx(_Float32x, _Float64x, _Float128x, _Float32x _Complex, bool volatile)
+xxx
+--format=auto --no-params
+_Z3xxxDF16b
+xxx(std::bfloat16_t)
 xxx
 # https://sourceware.org/bugzilla/show_bug.cgi?id=16817
 --format=auto --no-params
@@ -1570,3 +1578,84 @@ initializer for module Foo.Bar
 
 _ZGIW3FooWP3BarW3Baz
 initializer for module Foo:Bar.Baz
+
+_ZZ2L1vENKUlDpT_E_clIJiPiEEEvS0_
+void L1()::{lambda((auto:1)...)#1}::operator()<int, int*>(int, int*) const
+
+_ZZ2L1vENKUlDpT_E_clIJiPiEEEDaS0_
+auto L1()::{lambda((auto:1)...)#1}::operator()<int, int*>(int, int*) const
+
+_Z7captureIN4gvarMUlvE_EE7WrapperIT_EOS3_
+Wrapper<gvar::{lambda()#1}> capture<gvar::{lambda()#1}>(gvar::{lambda()#1}&&)
+
+_ZNK2L2MUlT_T0_E_clIifEEvS_S0_
+void L2::{lambda(auto:1, auto:2)#1}::operator()<int, float>(L2, int) const
+
+_ZNK1C1fMUlT_E_clIMS_iEEDaS1_
+auto C::f::{lambda(auto:1)#1}::operator()<int C::*>(int C::*) const
+
+_ZNK2L2MUlT_T0_E_clIifEEvS0_S1_
+void L2::{lambda(auto:1, auto:2)#1}::operator()<int, float>(int, float) const
+
+_ZNK1B2L3MUlT_T0_E_clIjdEEvS1_S2_
+void B::L3::{lambda(auto:1, auto:2)#1}::operator()<unsigned int, double>(unsigned int, double) const
+
+_Z3fooIN1qMUlvE_ENS0_UlvE0_EEiOT_OT0_
+int foo<q::{lambda()#1}, q::{lambda()#2}>(q::{lambda()#1}&&, q::{lambda()#2}&&)
+
+_ZNK2L1MUlDpT_E_clIJiPiEEEvS1_
+void L1::{lambda((auto:1)...)#1}::operator()<int, int*>(int, int*) const
+
+_ZZN1XIfLj0EE2FnEvENKUlTyfT_E_clIiEEDafS1_
+auto X<float, 0u>::Fn()::{lambda<typename $T0>(float, $T0)#1}::operator()<int>(float, int) const
+
+_ZZN1XIfLj0EE2FnEvENKUlTyT_E_clIiEEDaS1_
+auto X<float, 0u>::Fn()::{lambda<typename $T0>($T0)#1}::operator()<int>(int) const
+
+_ZZN1XIfLj1EE2FnEvENKUlTyfT_E_clIiEEDafS1_
+auto X<float, 1u>::Fn()::{lambda<typename $T0>(float, $T0)#1}::operator()<int>(float, int) const
+
+_ZZN1XIfLj1EE2FnEvENKUlTyT_E_clIiEEDaS1_
+auto X<float, 1u>::Fn()::{lambda<typename $T0>($T0)#1}::operator()<int>(int) const
+
+_ZZN1XIiLj0EE2FnEvENKUlTyiT_E_clIiEEDaiS1_
+auto X<int, 0u>::Fn()::{lambda<typename $T0>(int, $T0)#1}::operator()<int>(int, int) const
+
+_ZZN1XIiLj0EE2FnEvENKUlTyT_E_clIiEEDaS1_
+auto X<int, 0u>::Fn()::{lambda<typename $T0>($T0)#1}::operator()<int>(int) const
+
+_ZNK10l_tpl_autoMUlTyT_T0_E_clIiiEEDaS0_S1_
+auto l_tpl_auto::{lambda<typename $T0>($T0, auto:2)#1}::operator()<int, int>(int, int) const
+
+_ZNK12l_tpl_nt_aryMUlTniRAT__iE_clILi2EEEDaS1_
+auto l_tpl_nt_ary::{lambda<int $N0>(int (&) [$N0])#1}::operator()<2>(int (&) [2]) const
+
+_ZNK13l_tpl_nt_autoMUlTnDavE_clILi0EEEDav
+auto l_tpl_nt_auto::{lambda<auto $N0>()#1}::operator()<0>() const
+
+_ZNK9l_tpl_tplMUlTtTyTnjER3TPLIT_EE_clI1UEEDaS3_
+auto l_tpl_tpl::{lambda<template<typename, unsigned int> class $TT0>(TPL<$TT0>&)#1}::operator()<U>(TPL<U>&) const
+
+_ZNK13l_tpl_tpl_tplMUlTtTtTyTnjEER6TPLTPLIT_EE_clI3TPLEEDaS3_
+auto l_tpl_tpl_tpl::{lambda<template<template<typename, unsigned int> class> class $TT0>(TPLTPL<$TT0>&)#1}::operator()<TPL>(TPLTPL<TPL>&) const
+
+_ZNK5l_varMUlTpTyDpT_E_clIJiiiEEEDaS1_
+auto l_var::{lambda<typename... $T0>(($T0)...)#1}::operator()<int, int, int>(int, int, int) const
+
+_ZNK6l_var2MUlTpTniDpRAT__iE_clIJLi2ELi2EEEEDaS2_
+auto l_var2::{lambda<int... $N0>((int (&) [$N0])...)#1}::operator()<2, 2>(int (&) [2], int (&) [2]) const
+
+_ZNK6l_var3MUlTtTpTniETpTniRT_IJXspT0_EEEE_clI1XJLi1ELi2ELi3EEEEDaS2_
+auto l_var3::{lambda<template<int...> class $TT0, int... $N1>($TT0<($N1)...>&)#1}::operator()<X, 1, 2, 3>(X<1, 2, 3>&) const
+
+_ZNK6l_var4MUlTpTtTyTnjER1YIJDpT_EEE_clIJ1US7_EEEDaS4_
+auto l_var4::{lambda<template<typename, unsigned int> class... $TT0>(Y<($TT0)...>&)#1}::operator()<U, U>(Y<U, U>&) const
+
+_ZZ2FnILi1EEvvENKUlTyT_E_clIiEEDaS0_
+auto Fn<1>()::{lambda<typename $T0>($T0)#1}::operator()<int>(int) const
+
+_ZZ1fvENKUlTyP1XIT_EPS_IiEE_clIcEEDaS2_S4_
+auto f()::{lambda<typename $T0>(X<$T0>*, X<int>*)#1}::operator()<char>(X<char>*, X<int>*) const
+
+_ZZN1XIiE1FEvENKUliE_clEi
+X<int>::F()::{lambda(int)#1}::operator()(int) const

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [binutils-gdb] Sync libiberty sources with GCC mainline.
@ 2017-03-01 15:10 Nick Clifton
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2017-03-01 15:10 UTC (permalink / raw)
  To: bfd-cvs, gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=134e805d3e18cf700a5046912b8dca9301fe6f2e

commit 134e805d3e18cf700a5046912b8dca9301fe6f2e
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Mar 1 15:09:29 2017 +0000

    Sync libiberty sources with GCC mainline.
    
    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).

Diff:
---
 libiberty/ChangeLog                   | 64 +++++++++++++++++++++++------------
 libiberty/cp-demangle.c               | 24 +++++++++++--
 libiberty/testsuite/demangle-expected | 23 +++++++++++++
 3 files changed, 87 insertions(+), 24 deletions(-)

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  <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>
 
@@ -14,16 +38,24 @@
 	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>
 
@@ -90,10 +122,6 @@
 	* 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.
@@ -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  <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.
@@ -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  <hongjiu.lu@intel.com>
-
-	* configure: Regenerated.
-
 2015-07-13  Mikhail Maltsev  <maltsevm@gmail.com>
 
 	* cp-demangle.c (d_dump): Fix syntax error.
@@ -510,8 +530,8 @@
 	* 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.
@@ -736,7 +756,7 @@
 	(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.
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)
     }
 }
 
-/* <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;
 }
 
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*, 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+>)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [binutils-gdb] Sync libiberty sources with gcc mainline.
@ 2016-10-17  9:27 Nick Clifton
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2016-10-17  9:27 UTC (permalink / raw)
  To: bfd-cvs, gdb-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 15425 bytes --]

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=41f225defe891ff71d3c8a149cdc1ed8f3a64c5c

commit 41f225defe891ff71d3c8a149cdc1ed8f3a64c5c
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Oct 17 10:26:56 2016 +0100

    Sync libiberty sources with gcc mainline.
    
    2016-09-19  Andrew Stubbs  <ams@codesourcery.com>
    
    	* pex-win32.c (argv_to_cmdline): Quote zero-length parameters.
    	* testsuite/test-pexecute.c (main): Insert check for zero-length parameters.
    
    2016-09-10  Mark Wielaard  <mjw@redhat.com>
    
    	* cp-demangle.c (d_substitution): Change struct demangle_component
    	variable name from c to dc.
    
    2016-08-12  Marek Polacek  <polacek@redhat.com>
    
    	PR c/7652
    	* cp-demangle.c (d_print_mod): Add FALLTHRU.
    
    2016-08-04  Marcel B?hme  <boehme.marcel@gmail.com>
    
    	PR c++/71696
    	* cplus-dem.c: Prevent infinite recursion when there is a cycle
    	in the referencing of remembered mangled types.
    	(work_stuff): New stack to keep track of the remembered mangled
    	types that are currently being processed.
    	(push_processed_type): New method to push currently processed
    	remembered type onto the stack.
    	(pop_processed_type): New method to pop currently processed
    	remembered type from the stack.
    	(work_stuff_copy_to_from): Copy values of new variables.
    	(delete_non_B_K_work_stuff): Free stack memory.
    	(demangle_args): Push/Pop currently processed remembered type.
    	(do_type): Do not demangle a cyclic reference and push/pop
    	referenced remembered type.

Diff:
---
 libiberty/ChangeLog                 | 73 +++++++++++++++++++++++----------
 libiberty/cp-demangle.c             | 12 +++---
 libiberty/cplus-dem.c               | 80 ++++++++++++++++++++++++++++++++++---
 libiberty/pex-win32.c               |  4 ++
 libiberty/testsuite/test-pexecute.c | 14 +++++++
 5 files changed, 152 insertions(+), 31 deletions(-)

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index eb96674..0865428 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,39 @@
+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.
+	* testsuite/test-pexecute.c (main): Insert check for zero-length parameters.
+
+2016-09-10  Mark Wielaard  <mjw@redhat.com>
+
+	* cp-demangle.c (d_substitution): Change struct demangle_component
+	variable name from c to dc.
+
+2016-08-12  Marek Polacek  <polacek@redhat.com>
+
+	PR c/7652
+	* cp-demangle.c (d_print_mod): Add FALLTHRU.
+
+2016-08-04  Marcel Böhme  <boehme.marcel@gmail.com>
+
+	PR c++/71696
+	* cplus-dem.c: Prevent infinite recursion when there is a cycle
+	in the referencing of remembered mangled types.
+	(work_stuff): New stack to keep track of the remembered mangled
+	types that are currently being processed.
+	(push_processed_type): New method to push currently processed
+	remembered type onto the stack.
+	(pop_processed_type): New method to pop currently processed
+	remembered type from the stack.
+	(work_stuff_copy_to_from): Copy values of new variables.
+	(delete_non_B_K_work_stuff): Free stack memory.
+	(demangle_args): Push/Pop currently processed remembered type.
+	(do_type): Do not demangle a cyclic reference and push/pop
+	referenced remembered type.
+
 2016-07-29  Aldy Hernandez  <aldyh@redhat.com>
 
 	* make-relative-prefix.c (make_relative_prefix_1): Fall back to
@@ -16,7 +52,7 @@
 	(d_template_args_1): Split out from d_template_args.
 	(d_args_length): New.
 
-2016-07-13  Marcel BÃhme  <boehme.marcel@gmail.com>
+2016-07-13  Marcel Böhme  <boehme.marcel@gmail.com>
 
 	PR c++/70926
 	* cplus-dem.c: Handle large values and overflow when demangling
@@ -143,8 +179,6 @@
 
 	PR other/61321
 	PR other/61233
-	* demangle.h (enum demangle_component_type)
-	<DEMANGLE_COMPONENT_CONVERSION>: New value.
 	* cp-demangle.c (d_demangle_callback, d_make_comp): Handle
 	DEMANGLE_COMPONENT_CONVERSION.
 	(is_ctor_dtor_or_conversion): Handle DEMANGLE_COMPONENT_CONVERSION
@@ -739,11 +773,11 @@
 2013-05-31  Matt Burgess <matthew@linuxfromscratch.org>
 
 	PR other/56780
-	* libiberty/configure.ac: Move test for --enable-install-libiberty
+	* configure.ac: Move test for --enable-install-libiberty
 	outside of the 'with_target_subdir' test so that it actually gets
 	run.  Add output messages to show the test result.
-	* libiberty/configure: Regenerate.
-	* libiberty/Makefile.in (install_to_libdir): Place the
+	* configure: Regenerate.
+	* Makefile.in (install_to_libdir): Place the
 	installation of the libiberty library in the same guard as that
 	used for the headers to prevent it being installed unless
 	requested via --enable-install-libiberty.
@@ -1543,7 +1577,6 @@
 	Daniel Jacobowitz  <dan@codesourcery.com>
 	Pedro Alves  <pedro@codesourcery.com>
 
-	libiberty/
 	* argv.c (consume_whitespace): New function.
 	(only_whitespace): New function.
 	(buildargv): Always use ISSPACE by calling consume_whitespace.
@@ -1744,8 +1777,8 @@
 
 2009-04-07  Arnaud Patard <apatard@mandriva.com>
 
-	* libiberty/configure.ac: Fix Linux/MIPS matching rule.
-	* libiberty/configure: Regenerate.
+	* configure.ac: Fix Linux/MIPS matching rule.
+	* configure: Regenerate.
 
 2009-03-27  Ian Lance Taylor  <iant@google.com>
 
@@ -1908,8 +1941,8 @@
 
 2008-04-21  Aurelien Jarno  <aurelien@aurel32.net>
 
-	* libiberty/configure.ac: use -fPIC on Linux/MIPS hosts.
-	* libiberty/configure: Regenerate.
+	* configure.ac: use -fPIC on Linux/MIPS hosts.
+	* configure: Regenerate.
 
 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
 
@@ -2115,7 +2148,7 @@
 	that are locale-independent.
 	* Makefile.in (filename_cmp.o): Add dependency on safe-ctype.h.
 
-2007-04-11  Thomas Neumann  tneumann@users.sourceforge.net
+2007-04-11  Thomas Neumann  <tneumann@users.sourceforge.net>
 
 	* argv.c: Use ANSI C declarations.
 	* make-relative-prefix.c: Likewise.
@@ -3687,7 +3720,7 @@
 
 2003-12-15  Brendan Kehoe  <brendan@zen.org>
 
-	* libiberty/Makefile.in (floatformat.o): Add dependency on
+	* Makefile.in (floatformat.o): Add dependency on
 	config.h to accompany change of 2003-12-03.
 
 2003-12-15  Ian Lance Taylor  <ian@wasabisystems.com>
@@ -4383,7 +4416,7 @@
 
 2002-10-06  Andreas Jaeger  <aj@suse.de>
 
-	* libiberty/cplus-dem.c (ada_demangle): Get rid of unneeded
+	* cplus-dem.c (ada_demangle): Get rid of unneeded
 	variable and of strict-aliasing warning.
 	(grow_vect): Use char as first parameter.
 
@@ -4651,7 +4684,7 @@
 
 2002-01-31  Adam Megacz  <adam@xwt.org>
 
-	* gcc/libiberty/configure.in: Treat mingw the same as cywin
+	* configure.in: Treat mingw the same as cywin
 	wrt HAVE_SYS_ERRLIST.
 
 2002-01-30  Phil Edwards  <pme@gcc.gnu.org>
@@ -5159,8 +5192,8 @@ Tue Aug 21 12:35:04 2001  Christopher Faylor <cgf@cygnus.com>
 2001-03-10  Neil Booth  <neil@daikokuya.demon.co.uk>
 	    John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
-	* libiberty/lbasename.c: New file.
-	* libiberty/Makefile.in: Update for lbasename.
+	* lbasename.c: New file.
+	* Makefile.in: Update for lbasename.
 
 2001-03-06  Zack Weinberg  <zackw@stanford.edu>
 
@@ -5533,13 +5566,13 @@ Tue Aug 21 12:35:04 2001  Christopher Faylor <cgf@cygnus.com>
 
 2000-08-24  Greg McGary  <greg@mcgary.org>
 
-	* libiberty/random.c (end_ptr): Revert previous change.
+	* random.c (end_ptr): Revert previous change.
 
 2000-08-24  Greg McGary  <greg@mcgary.org>
 
-	* libiberty/cplus-dem.c (cplus_demangle_opname, cplus_mangle_opname,
+	* cplus-dem.c (cplus_demangle_opname, cplus_mangle_opname,
 	demangle_expression, demangle_function_name): Use ARRAY_SIZE.
-	* libiberty/random.c (end_ptr): Likewise.
+	* random.c (end_ptr): Likewise.
 
 2000-08-23  Alex Samuel  <samuel@codesourcery.com>
 
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 0c6d714..a843dc3 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3769,7 +3769,7 @@ d_substitution (struct d_info *di, int prefix)
 	    {
 	      const char *s;
 	      int len;
-	      struct demangle_component *c;
+	      struct demangle_component *dc;
 
 	      if (p->set_last_name != NULL)
 		di->last_name = d_make_sub (di, p->set_last_name,
@@ -3785,15 +3785,15 @@ d_substitution (struct d_info *di, int prefix)
 		  len = p->simple_len;
 		}
 	      di->expansion += len;
-	      c = d_make_sub (di, s, len);
+	      dc = d_make_sub (di, s, len);
 	      if (d_peek_char (di) == 'B')
 		{
 		  /* If there are ABI tags on the abbreviation, it becomes
 		     a substitution candidate.  */
-		  c = d_abi_tags (di, c);
-		  d_add_substitution (di, c);
+		  dc = d_abi_tags (di, dc);
+		  d_add_substitution (di, dc);
 		}
-	      return c;
+	      return dc;
 	    }
 	}
 
@@ -5777,11 +5777,13 @@ d_print_mod (struct d_print_info *dpi, int options,
     case DEMANGLE_COMPONENT_REFERENCE_THIS:
       /* For the ref-qualifier, put a space before the &.  */
       d_append_char (dpi, ' ');
+      /* FALLTHRU */
     case DEMANGLE_COMPONENT_REFERENCE:
       d_append_char (dpi, '&');
       return;
     case DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS:
       d_append_char (dpi, ' ');
+      /* FALLTHRU */
     case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
       d_append_string (dpi, "&&");
       return;
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 3ee2df1..f954050 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -144,6 +144,9 @@ struct work_stuff
   string* previous_argument; /* The last function argument demangled.  */
   int nrepeats;         /* The number of times to repeat the previous
 			   argument.  */
+  int *proctypevec;     /* Indices of currently processed remembered typevecs.  */
+  int proctypevec_size;
+  int nproctypes;
 };
 
 #define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
@@ -436,6 +439,10 @@ iterate_demangle_function (struct work_stuff *,
 
 static void remember_type (struct work_stuff *, const char *, int);
 
+static void push_processed_type (struct work_stuff *, int);
+
+static void pop_processed_type (struct work_stuff *);
+
 static void remember_Btype (struct work_stuff *, const char *, int, int);
 
 static int register_Btype (struct work_stuff *);
@@ -1302,6 +1309,10 @@ work_stuff_copy_to_from (struct work_stuff *to, struct work_stuff *from)
       memcpy (to->btypevec[i], from->btypevec[i], len);
     }
 
+  if (from->proctypevec)
+    to->proctypevec =
+      XDUPVEC (int, from->proctypevec, from->proctypevec_size);
+
   if (from->ntmpl_args)
     to->tmpl_argvec = XNEWVEC (char *, from->ntmpl_args);
 
@@ -1330,11 +1341,17 @@ delete_non_B_K_work_stuff (struct work_stuff *work)
   /* Discard the remembered types, if any.  */
 
   forget_types (work);
-  if (work -> typevec != NULL)
+  if (work->typevec != NULL)
     {
-      free ((char *) work -> typevec);
-      work -> typevec = NULL;
-      work -> typevec_size = 0;
+      free ((char *) work->typevec);
+      work->typevec = NULL;
+      work->typevec_size = 0;
+    }
+  if (work->proctypevec != NULL)
+    {
+      free (work->proctypevec);
+      work->proctypevec = NULL;
+      work->proctypevec_size = 0;
     }
   if (work->tmpl_argvec)
     {
@@ -3555,6 +3572,8 @@ static int
 do_type (struct work_stuff *work, const char **mangled, string *result)
 {
   int n;
+  int i;
+  int is_proctypevec;
   int done;
   int success;
   string decl;
@@ -3567,6 +3586,7 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
 
   done = 0;
   success = 1;
+  is_proctypevec = 0;
   while (success && !done)
     {
       int member;
@@ -3627,8 +3647,15 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
 	      success = 0;
 	    }
 	  else
-	    {
-	      remembered_type = work -> typevec[n];
+	    for (i = 0; i < work->nproctypes; i++)
+	      if (work -> proctypevec [i] == n)
+	        success = 0;
+
+	  if (success)
+	    {    
+	      is_proctypevec = 1;
+	      push_processed_type (work, n);
+	      remembered_type = work->typevec[n];
 	      mangled = &remembered_type;
 	    }
 	  break;
@@ -3850,6 +3877,9 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
     string_delete (result);
   string_delete (&decl);
 
+  if (is_proctypevec)
+    pop_processed_type (work); 
+
   if (success)
     /* Assume an integral type, if we're not sure.  */
     return (int) ((tk == tk_none) ? tk_integral : tk);
@@ -4263,6 +4293,41 @@ do_arg (struct work_stuff *work, const char **mangled, string *result)
 }
 
 static void
+push_processed_type (struct work_stuff *work, int typevec_index)
+{
+  if (work->nproctypes >= work->proctypevec_size)
+    {
+      if (!work->proctypevec_size)
+	{
+	  work->proctypevec_size = 4;
+	  work->proctypevec = XNEWVEC (int, work->proctypevec_size);
+	}
+      else 
+	{
+	  if (work->proctypevec_size < 16)
+	    /* Double when small.  */
+	    work->proctypevec_size *= 2;
+	  else
+	    {
+	      /* Grow slower when large.  */
+	      if (work->proctypevec_size > (INT_MAX / 3) * 2)
+                xmalloc_failed (INT_MAX);
+              work->proctypevec_size = (work->proctypevec_size * 3 / 2);
+	    }   
+          work->proctypevec
+            = XRESIZEVEC (int, work->proctypevec, work->proctypevec_size);
+	}
+    }
+    work->proctypevec [work->nproctypes++] = typevec_index;
+}
+
+static void
+pop_processed_type (struct work_stuff *work)
+{
+  work->nproctypes--;
+}
+
+static void
 remember_type (struct work_stuff *work, const char *start, int len)
 {
   char *tem;
@@ -4526,10 +4591,13 @@ demangle_args (struct work_stuff *work, const char **mangled,
 		{
 		  string_append (declp, ", ");
 		}
+	      push_processed_type (work, t);  
 	      if (!do_arg (work, &tem, &arg))
 		{
+		  pop_processed_type (work);
 		  return (0);
 		}
+	      pop_processed_type (work);
 	      if (PRINT_ARG_TYPES)
 		{
 		  string_appends (declp, &arg);
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
index 66d2f11..4c15b0d 100644
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -370,6 +370,8 @@ argv_to_cmdline (char *const *argv)
 	      cmdline_len++;
 	    }
 	}
+      if (j == 0)
+	needs_quotes = 1;
       /* Trailing backslashes also need to be escaped because they will be
          followed by the terminating quote.  */
       if (needs_quotes)
@@ -394,6 +396,8 @@ argv_to_cmdline (char *const *argv)
               break;
             }
         }
+      if (j == 0)
+	needs_quotes = 1;
 
       if (needs_quotes)
         {
diff --git a/libiberty/testsuite/test-pexecute.c b/libiberty/testsuite/test-pexecute.c
index 8e01fda..f62239d 100644
--- a/libiberty/testsuite/test-pexecute.c
+++ b/libiberty/testsuite/test-pexecute.c
@@ -285,6 +285,20 @@ main (int argc, char **argv)
     ERROR ("echo exit status failed");
   pex_free (pex1);
 
+  /* Check empty parameters don't get lost.  */
+  pex1 = TEST_PEX_INIT (PEX_USE_PIPES, "temp");
+  subargv[1] = "echo";
+  subargv[2] = "foo";
+  subargv[3] = "";
+  subargv[4] = "bar";
+  subargv[5] = NULL;
+  TEST_PEX_RUN (pex1, 0, "./test-pexecute", subargv, NULL, NULL);
+  e = TEST_PEX_READ_OUTPUT (pex1);
+  CHECK_LINE (e, "foo  bar");  /* Two spaces!  */
+  if (TEST_PEX_GET_STATUS_1 (pex1) != 0)
+    ERROR ("echo exit status failed");
+  pex_free (pex1);
+
   pex1 = TEST_PEX_INIT (PEX_USE_PIPES, "temp");
   subargv[1] = "echo";
   subargv[2] = "bar";


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-31 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-31 12:04 [binutils-gdb] sync libiberty sources with gcc mainline Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2017-03-01 15:10 [binutils-gdb] Sync libiberty sources with GCC mainline Nick Clifton
2016-10-17  9:27 [binutils-gdb] Sync libiberty sources with gcc mainline Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).