+2019-04-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/86986 - ICE with TTP with parameter pack.
+ * pt.c (coerce_template_parameter_pack): Only look at the type of a
+ non-type parameter pack.
+ (fixed_parameter_pack_p_1): Don't recurse into the type of a
+ non-type parameter pack.
+ (coerce_template_template_parms): Call add_outermost_template_args.
+
2019-04-04 Martin Sebor <msebor@redhat.com>
PR c++/89974
tree vec = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (parm));
for (int i = 0; i < TREE_VEC_LENGTH (vec); ++i)
- fixed_parameter_pack_p_1 (TREE_VALUE (TREE_VEC_ELT (vec, i)), ppd);
+ {
+ tree p = TREE_VALUE (TREE_VEC_ELT (vec, i));
+ if (template_parameter_pack_p (p))
+ /* Any packs in the type are expanded by this parameter. */;
+ else
+ fixed_parameter_pack_p_1 (p, ppd);
+ }
}
/* PARM is a template parameter pack. Return any parameter packs used in
args and the converted args. If that succeeds, A is at least as
specialized as P, so they match.*/
tree pargs = template_parms_level_to_args (parm_parms);
+ pargs = add_outermost_template_args (outer_args, pargs);
++processing_template_decl;
pargs = coerce_template_parms (arg_parms, pargs, NULL_TREE, tf_none,
/*require_all*/true, /*use_default*/true);
int j, len = TREE_VEC_LENGTH (packed_parms);
for (j = 0; j < len; ++j)
{
- tree t = TREE_TYPE (TREE_VEC_ELT (packed_parms, j));
- if (invalid_nontype_parm_type_p (t, complain))
+ tree t = TREE_VEC_ELT (packed_parms, j);
+ if (TREE_CODE (t) == PARM_DECL
+ && invalid_nontype_parm_type_p (TREE_TYPE (t), complain))
return error_mark_node;
}
/* We don't know how many args we have yet, just