Synchromize libiberty sources with master version in gcc repository

This commit is contained in:
Nick Clifton
2023-06-26 15:47:15 +01:00
parent 996ff3e8c5
commit 0bbc38601f
11 changed files with 363 additions and 122 deletions

View File

@@ -1947,6 +1947,7 @@ const struct demangle_operator_info cplus_demangle_operators[] =
{ "ng", NL ("-"), 1 },
{ "nt", NL ("!"), 1 },
{ "nw", NL ("new"), 3 },
{ "nx", NL ("noexcept"), 1 },
{ "oR", NL ("|="), 2 },
{ "oo", NL ("||"), 2 },
{ "or", NL ("|"), 2 },
@@ -5836,8 +5837,8 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
if (code && !strcmp (code, "gs"))
/* Avoid parens after '::'. */
d_print_comp (dpi, options, operand);
else if (code && !strcmp (code, "st"))
/* Always print parens for sizeof (type). */
else if (code && (!strcmp (code, "st") || !strcmp (code, "nx")))
/* Always print parens for sizeof (type) and noexcept(expr). */
{
d_append_char (dpi, '(');
d_print_comp (dpi, options, operand);
@@ -6659,32 +6660,10 @@ d_print_conversion (struct d_print_info *dpi, int options,
dpt.template_decl = dpi->current_template;
}
if (d_left (dc)->type != DEMANGLE_COMPONENT_TEMPLATE)
{
d_print_comp (dpi, options, d_left (dc));
if (dpi->current_template != NULL)
dpi->templates = dpt.next;
}
else
{
d_print_comp (dpi, options, d_left (d_left (dc)));
d_print_comp (dpi, options, d_left (dc));
/* For a templated cast operator, we need to remove the template
parameters from scope after printing the operator name,
so we need to handle the template printing here. */
if (dpi->current_template != NULL)
dpi->templates = dpt.next;
if (d_last_char (dpi) == '<')
d_append_char (dpi, ' ');
d_append_char (dpi, '<');
d_print_comp (dpi, options, d_right (d_left (dc)));
/* Avoid generating two consecutive '>' characters, to avoid
the C++ syntactic ambiguity. */
if (d_last_char (dpi) == '>')
d_append_char (dpi, ' ');
d_append_char (dpi, '>');
}
if (dpi->current_template != NULL)
dpi->templates = dpt.next;
}
/* Initialize the information structure we use to pass around