2018-06-21 Jason Merrill <jason@redhat.com>
+ * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Use TEMPLATE_PARM_DESCENDANTS.
+
* name-lookup.c (do_push_to_top_level): Don't allocate
current_lang_base.
(do_pop_from_top_level): Release current_lang_base.
&& !PLACEHOLDER_TYPE_CONSTRAINTS (r))
/* Break infinite recursion when substituting the constraints
of a constrained placeholder. */;
+ else if (TREE_CODE (t) == TEMPLATE_TYPE_PARM
+ && !PLACEHOLDER_TYPE_CONSTRAINTS (t)
+ && !CLASS_PLACEHOLDER_TEMPLATE (t)
+ && (arg = TEMPLATE_TYPE_PARM_INDEX (t),
+ r = TEMPLATE_PARM_DESCENDANTS (arg))
+ && (TEMPLATE_PARM_LEVEL (r)
+ == TEMPLATE_PARM_LEVEL (arg) - levels))
+ /* Cache the simple case of lowering a type parameter. */
+ r = TREE_TYPE (r);
else
{
r = copy_type (t);