summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog8
-rw-r--r--libiberty/cp-demangle.c17
-rw-r--r--libiberty/testsuite/demangle-expected6
3 files changed, 30 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a5f8742cee7..91211c87e7d 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,11 @@
+2018-10-23 Jason Merrill <jason@redhat.com>
+
+ Implement P0732R2, class types in non-type template parameters.
+ * cp-demangle.c (d_dump, d_make_comp, d_count_templates_scopes)
+ (d_print_comp_inner): Handle DEMANGLE_COMPONENT_TPARM_OBJ.
+ (d_special_name): Handle TA.
+ (d_expresion_1): Fix demangling of brace-enclosed initializer list.
+
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 3f2a097e7f2..a1f74a51c9c 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -625,6 +625,9 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_TEMPLATE_PARAM:
printf ("template parameter %ld\n", dc->u.s_number.number);
return;
+ case DEMANGLE_COMPONENT_TPARM_OBJ:
+ printf ("template parameter object\n");
+ break;
case DEMANGLE_COMPONENT_FUNCTION_PARAM:
printf ("function parameter %ld\n", dc->u.s_number.number);
return;
@@ -1007,6 +1010,7 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS:
case DEMANGLE_COMPONENT_NULLARY:
case DEMANGLE_COMPONENT_TRINARY_ARG2:
+ case DEMANGLE_COMPONENT_TPARM_OBJ:
if (left == NULL)
return NULL;
break;
@@ -2007,6 +2011,7 @@ d_java_resource (struct d_info *di)
::= TT <type>
::= TI <type>
::= TS <type>
+ ::= TA <template-arg>
::= GV <(object) name>
::= T <call-offset> <(base) encoding>
::= Tc <call-offset> <call-offset> <(base) encoding>
@@ -2099,6 +2104,10 @@ d_special_name (struct d_info *di)
return d_make_comp (di, DEMANGLE_COMPONENT_TLS_WRAPPER,
d_name (di), NULL);
+ case 'A':
+ return d_make_comp (di, DEMANGLE_COMPONENT_TPARM_OBJ,
+ d_template_arg (di), NULL);
+
default:
return NULL;
}
@@ -3327,11 +3336,11 @@ d_expression_1 (struct d_info *di)
{
/* Brace-enclosed initializer list, untyped or typed. */
struct demangle_component *type = NULL;
+ d_advance (di, 2);
if (peek == 't')
type = cplus_demangle_type (di);
if (!d_peek_next_char (di))
return NULL;
- d_advance (di, 2);
return d_make_comp (di, DEMANGLE_COMPONENT_INITIALIZER_LIST,
type, d_exprlist (di, 'E'));
}
@@ -4101,6 +4110,7 @@ d_count_templates_scopes (int *num_templates, int *num_scopes,
case DEMANGLE_COMPONENT_VECTOR_TYPE:
case DEMANGLE_COMPONENT_ARGLIST:
case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
+ case DEMANGLE_COMPONENT_TPARM_OBJ:
case DEMANGLE_COMPONENT_INITIALIZER_LIST:
case DEMANGLE_COMPONENT_CAST:
case DEMANGLE_COMPONENT_CONVERSION:
@@ -4872,6 +4882,11 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
}
return;
+ case DEMANGLE_COMPONENT_TPARM_OBJ:
+ d_append_string (dpi, "template parameter object for ");
+ d_print_comp (dpi, options, d_left (dc));
+ return;
+
case DEMANGLE_COMPONENT_CTOR:
d_print_comp (dpi, options, dc->u.s_ctor.name);
return;
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index b62561c6d4d..40038365c83 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4667,6 +4667,12 @@ void eat<int*, Foo()::{lambda(auto:1*, auto:2*)#6}>(int*&, Foo()::{lambda(auto:1
_Z3eatIPiZ3BarIsEvvEUlPsPT_PT0_E0_EvRS3_RS5_
void eat<int*, Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}>(int*&, Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}&)
+_Z1fP1BIXtl1ALi1EEEE
+f(B<A{1}>*)
+
+_ZTAXtl1ALi1EEE
+template parameter object for A{1}
+
# PR 77489
_ZZ3foovE8localVar_9
foo()::localVar