aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2021-10-07 10:02:54 -0400
committerPatrick Palka <ppalka@redhat.com>2021-10-07 10:02:54 -0400
commit2e6e0d86a06389056d0e7fecc99c547420ad787a (patch)
tree135d1870a5006339b21054e2fcec4ed1d5d3a0c1 /gcc/cp
parent9b239d05ffd5a17ede44abd55bc6622c6e279868 (diff)
downloadgcc-2e6e0d86a06389056d0e7fecc99c547420ad787a.zip
gcc-2e6e0d86a06389056d0e7fecc99c547420ad787a.tar.gz
gcc-2e6e0d86a06389056d0e7fecc99c547420ad787a.tar.bz2
c++: variadic ttp constraint subsumption [PR99904]
Here we're crashing when level-lowering the variadic constraint C<Ts...> on the template template parameter TT because tsubst_pack_expansion expects processing_template_decl to be set during a partial substitution. PR c++/99904 gcc/cp/ChangeLog: * pt.c (is_compatible_template_arg): Set processing_template_decl around tsubst_constraint_info. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-ttp4.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/pt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 19e0336..1e52aa7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -8230,8 +8230,10 @@ is_compatible_template_arg (tree parm, tree arg)
{
tree aparms = DECL_INNERMOST_TEMPLATE_PARMS (arg);
new_args = template_parms_level_to_args (aparms);
+ ++processing_template_decl;
parm_cons = tsubst_constraint_info (parm_cons, new_args,
tf_none, NULL_TREE);
+ --processing_template_decl;
if (parm_cons == error_mark_node)
return false;
}