aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constraint.cc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2020-11-09 18:12:42 -0500
committerPatrick Palka <ppalka@redhat.com>2020-11-09 18:12:42 -0500
commit71a8040716c1342547a19c25bd0203ac29258ef3 (patch)
treeedadddaaefefcc9e7f9be09b28e6b71849d1dee3 /gcc/cp/constraint.cc
parent32ff3309ae5a17b3a504aef3361a8c1c30e49f2c (diff)
downloadgcc-71a8040716c1342547a19c25bd0203ac29258ef3.zip
gcc-71a8040716c1342547a19c25bd0203ac29258ef3.tar.gz
gcc-71a8040716c1342547a19c25bd0203ac29258ef3.tar.bz2
c++: Fix ICE with variadic concepts and aliases [PR93907]
This patch (naively) extends the PR93907 fix to also apply to variadic concepts invoked with a type argument pack. Without this, we ICE on the below testcase (a variadic version of concepts-using2.C) in the same manner as we used to on concepts-using2.C before r10-7133. gcc/cp/ChangeLog: PR c++/93907 * constraint.cc (tsubst_parameter_mapping): Also canonicalize the type arguments of a TYPE_ARGUMENT_PACk. gcc/testsuite/ChangeLog: PR c++/93907 * g++.dg/cpp2a/concepts-using3.C: New test, based off of concepts-using2.C.
Diffstat (limited to 'gcc/cp/constraint.cc')
-rw-r--r--gcc/cp/constraint.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index b6f6f0d..c871a8a 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -2252,6 +2252,16 @@ tsubst_parameter_mapping (tree map, tree args, subst_info info)
new_arg = tsubst_template_arg (arg, args, complain, in_decl);
if (TYPE_P (new_arg))
new_arg = canonicalize_type_argument (new_arg, complain);
+ if (TREE_CODE (new_arg) == TYPE_ARGUMENT_PACK)
+ {
+ tree pack_args = ARGUMENT_PACK_ARGS (new_arg);
+ for (int i = 0; i < TREE_VEC_LENGTH (pack_args); i++)
+ {
+ tree& pack_arg = TREE_VEC_ELT (pack_args, i);
+ if (TYPE_P (pack_arg))
+ pack_arg = canonicalize_type_argument (pack_arg, complain);
+ }
+ }
}
if (new_arg == error_mark_node)
return error_mark_node;