pt.c (tsubst <{NON,}TYPE_ARGUMENT_PACK>): Simplify control flow and avoid re-tsubsting type.
* pt.c (tsubst <{NON,}TYPE_ARGUMENT_PACK>: Simplify control flow and avoid re-tsubsting type. From-SVN: r243343
This commit is contained in:
parent
b3235e974f
commit
098eae0067
|
@ -1,5 +1,8 @@
|
||||||
2016-12-07 Nathan Sidwell <nathan@acm.org>
|
2016-12-07 Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
|
* pt.c (tsubst <{NON,}TYPE_ARGUMENT_PACK>: Simplify control flow
|
||||||
|
and avoid re-tsubsting type.
|
||||||
|
|
||||||
* cp-tree.h (enum cp_tree_index): Add CPTI_AUTO_IDENTIFIER &
|
* cp-tree.h (enum cp_tree_index): Add CPTI_AUTO_IDENTIFIER &
|
||||||
CPTI_DECLTYPE_AUTO_IDENTIFIER.
|
CPTI_DECLTYPE_AUTO_IDENTIFIER.
|
||||||
(auto_identifier, decltype_auto_identifier): New.
|
(auto_identifier, decltype_auto_identifier): New.
|
||||||
|
|
27
gcc/cp/pt.c
27
gcc/cp/pt.c
|
@ -13795,22 +13795,23 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
||||||
case TYPE_ARGUMENT_PACK:
|
case TYPE_ARGUMENT_PACK:
|
||||||
case NONTYPE_ARGUMENT_PACK:
|
case NONTYPE_ARGUMENT_PACK:
|
||||||
{
|
{
|
||||||
tree r = TYPE_P (t) ? cxx_make_type (code) : make_node (code);
|
tree r;
|
||||||
tree packed_out =
|
|
||||||
tsubst_template_args (ARGUMENT_PACK_ARGS (t),
|
|
||||||
args,
|
|
||||||
complain,
|
|
||||||
in_decl);
|
|
||||||
SET_ARGUMENT_PACK_ARGS (r, packed_out);
|
|
||||||
|
|
||||||
/* For template nontype argument packs, also substitute into
|
if (code == NONTYPE_ARGUMENT_PACK)
|
||||||
the type. */
|
{
|
||||||
if (code == NONTYPE_ARGUMENT_PACK)
|
r = make_node (code);
|
||||||
TREE_TYPE (r) = tsubst (TREE_TYPE (t), args, complain, in_decl);
|
/* Set the already-substituted type. */
|
||||||
|
TREE_TYPE (r) = type;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
r = cxx_make_type (code);
|
||||||
|
|
||||||
return r;
|
tree pack_args = ARGUMENT_PACK_ARGS (t);
|
||||||
|
pack_args = tsubst_template_args (pack_args, args, complain, in_decl);
|
||||||
|
SET_ARGUMENT_PACK_ARGS (r, pack_args);
|
||||||
|
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case VOID_CST:
|
case VOID_CST:
|
||||||
case INTEGER_CST:
|
case INTEGER_CST:
|
||||||
|
|
Loading…
Reference in New Issue