Lines Matching defs:pack

1223    We can also look up a FIELD_DECL, if it is a lambda capture pack; the
1719 /* tmpl could be a FIELD_DECL for a capture pack. */
3378 /* ... if either declares a pack, they both do. */
3487 /* Determine whether PARM is a parameter pack. */
3492 /* Determine if we have a non-type template parameter pack. */
3510 /* Determine if T is a function parameter pack. */
3535 from the function parameter pack PACK. */
3538 function_parameter_expanded_from_pack_p (tree param_decl, tree pack)
3541 || !function_parameter_pack_p (pack))
3544 /* The parameter pack and its pack arguments have the same
3546 return DECL_PARM_INDEX (pack) == DECL_PARM_INDEX (param_decl);
3550 i.e., one that is terminated by a template argument pack. */
3572 /* Generate a new name for the parameter pack name NAME (an
3688 /* Return the argument pack elements of T if T is a template argument pack,
3712 substituting of an argument pack (of which the Ith element is a pack
3713 expansion, where I is ARGUMENT_PACK_SELECT_INDEX) into a pack expansion.
3715 be a pack expansion, which pattern is the pattern of E. Let's return the
3717 resulting pack expansion from it. */
3730 pack. */
3747 parameter pack. */
3807 /* Return a TREE_VEC for the expansion of built-in template parameter pack
3835 /* True iff we're making a type pack expansion. */
3852 parameter pack is actually written in the expression/type we're
3865 /* Identify whether this is a parameter pack or not. */
3878 parameter pack (14.6.3), or the type-specifier-seq of a type-id that
3879 is a pack expansion, the invented template parameter is a template
3880 parameter pack. */
3892 because we don't want to see the type parameter pack. */
3902 because we don't want to see the type parameter pack. */
3924 /* Not a parameter pack. */
3930 /* Add this parameter pack to the list. */
3939 parameter pack. ??? Should some of these be in cp_walk_subtrees? */
3951 /* Ignore the declaration of a capture proxy for a parameter pack. */
4056 representation a base-class initializer into a parameter pack
4085 be passed to each base. We do not introduce any new pack
4129 /* Create the pack expansion type for the base type. */
4196 where "args" is a parameter pack. check_for_bare_parameter_packs
4212 /* A lambda might use a parameter pack from the containing context. */
4233 tree pack = TREE_VALUE (parameter_packs);
4236 if (TREE_CODE (pack) == TEMPLATE_TYPE_PARM
4237 || TREE_CODE (pack) == TEMPLATE_TEMPLATE_PARM)
4238 name = TYPE_NAME (pack);
4239 else if (TREE_CODE (pack) == TEMPLATE_PARM_INDEX)
4240 name = DECL_NAME (TEMPLATE_PARM_DECL (pack));
4241 else if (TREE_CODE (pack) == CALL_EXPR)
4242 name = DECL_NAME (CALL_EXPR_FN (pack));
4244 name = DECL_NAME (pack);
4496 parameter pack iff IS_PARAMETER_PACK is true. The location of PARM
4544 template parameter could be a parameter pack. */
4547 /* This template parameter is not a parameter pack, but it
4551 /* Recover by calling this a parameter pack. */
5081 primary template with a pack expansion is less specialized for those
5087 "with a pack expansion");
5125 Also, we verify that pack expansions only occur at the
5137 /* Extract the arguments from the argument pack. We'll be
5146 /* Get the Jth argument in the parameter pack. */
5157 error ("parameter pack argument %qE must be at the "
5160 error ("parameter pack argument %qT must be at the "
5352 /* PARM is a template parameter pack. Return any parameter packs used in
5363 /* This can only be true for a parameter pack. */
5492 /* A fixed parameter pack will be partially
5497 parameter pack, at the end of the template
5500 error ("parameter pack %q+D must be at the end of the"
6411 /* An alias template with a pack expansion that expands a pack from the
6413 the same pack being used as an argument to the alias's own template
6419 for (tree pack = PACK_EXPANSION_PARAMETER_PACKS (t); pack;
6420 pack = TREE_CHAIN (pack))
6422 tree parm_pack = TREE_VALUE (pack);
6748 " template parameter %qD is not a parameter pack, but "
6778 " inconsistent parameter pack deduction with %qT and %qT",
7602 /* Argument is a parameter pack but parameter is not. */
7624 /* Argument is a parameter pack but parameter is not. */
7793 /* If the P0522 adjustment eliminated a pack expansion, deduce
7810 /* Check if the parameters end in a pack, making them
7818 /* If the template argument list of P contains a pack
7894 PP declares a parameter pack, then AA is the pack expansion
7919 /* Determine whether we have a parameter pack at the end of the
7950 /* Check all of the template parameters except the parameter pack at
7970 argument against the template parameter pack at the end of
8024 /* Look inside the argument pack. */
8035 pack. */
8039 /* Look at the pattern of the pack expansion. */
8222 /* When determining whether an argument pack expansion is a template,
8491 ARG_IDX to the end) into the parameter pack at PARM_IDX in PARMS.
8492 Returns the coerced argument pack. PARM_IDX is the position of this
8517 /* When the template parameter is a non-type template parameter pack
8518 or template template parameter pack whose type or template
8539 template parameter pack are, in fact, valid for non-type
8559 /* Check if we have a placeholder pack, which indicates we're
8561 to match this pack to the single placeholder. */
8573 parameter pack "parm". */
8633 /* Returns the number of pack expansions in the template argument vector
8711 /* If there are no parameters that follow a parameter pack, we need to
8712 expand any argument packs so that we can deduce a parameter pack from
8713 some non-packed args followed by an argument pack, as in variadic85.C.
8717 template, as in variadic92.C, or when deducing a template parameter pack
8722 /* Count any pack expansion args. */
8754 /* We can't pass a pack expansion to a non-pack parameter of an alias
8774 "pack expansion argument for non-pack parameter "
8778 "pack expansion argument for non-pack parameter "
8822 template parameter pack PARM. */
8865 requires an empty template parameter pack, the template is
8877 "non-empty parameter pack would be ill-formed");
8921 /* This can also happen with a fixed parameter pack (71834). */
8947 /* We had some pack expansion arguments that will only work if the packs
8963 pack past the last parameter, we can accept the check as valid.
9696 other template, so if any of the arguments are pack expansions, strip
9697 the alias to avoid problems with a pack expansion passed to a non-pack
11291 T or a new TREE_LIST, possibly a chain in the case of a pack expansion. */
11415 /* An attribute pack expansion. */
11417 tree pack = tsubst_pack_expansion (val, args, complain, in_decl);
11418 if (pack == error_mark_node)
11420 int len = TREE_VEC_LENGTH (pack);
11425 tree elt = TREE_VEC_ELT (pack, i);
11666 /* Use #pragma pack from the template context. */
11904 /* A capture pack became multiple fields. */
12191 /* Given a function parameter pack TMPL_PARM and some function parameters
12199 argument pack. */
12212 /* The instantiation is still a parameter pack; don't wrap it in a
12239 /* Give a chain SPEC_PARM of PARM_DECLs, pack them into a
12248 /* Return 1 if the Ith element of the argument pack ARG_PACK is a
12249 pack expansion with no extra args, 2 if it has extra args, or 0
12250 if it is not a pack expansion. */
12263 /* A decl pack is itself an expansion. */
12290 substitution and return a non substituted pack expansion, in order
12299 /* If one pack has an expansion and another pack has a normal
12300 argument or if one pack has an empty argument and an another
12308 /* If all the actual packs are pack expansions, we can still
12337 /* We can't substitute a pack expansion with extra args into
12357 The instantiation of a pack expansion [...]
12359 in the pack expansion parameters.
12363 PATTERN is the pattern of the pack expansion. PARM_PACKS is a
12364 TREE_LIST in which each TREE_PURPOSE is a parameter pack of
12365 PATTERN, and each TREE_VALUE is its corresponding argument pack.
12388 /* For each parameter pack, change the substitution of the parameter
12389 pack to the ith argument in its argument pack, then expand the
12391 for (tree pack = parm_packs; pack; pack = TREE_CHAIN (pack))
12393 tree parm = TREE_PURPOSE (pack);
12394 tree arg_pack = TREE_VALUE (pack);
12400 /* Select the Ith argument from the pack. */
12436 /* Expanding a fixed parameter pack from
12447 /* If the Ith argument pack element is a pack expansion, then
12449 be a pack expansion as well. */
12456 /* When the unexpanded parameter pack in a fold expression expands to an empty
12515 /* Substitute ARGS into the pack of a fold expression T. */
12523 /* Substitute ARGS into the pack of a fold expression T. */
12532 Given a pack containing elements A0, A1, ..., An and an
12542 expand_left_fold (tree t, tree pack, tsubst_flags_t complain)
12544 tree left = TREE_VEC_ELT (pack, 0);
12545 for (int i = 1; i < TREE_VEC_LENGTH (pack); ++i)
12547 tree right = TREE_VEC_ELT (pack, i);
12559 tree pack = tsubst_fold_expr_pack (t, args, complain, in_decl);
12560 if (pack == error_mark_node)
12562 if (PACK_EXPANSION_P (pack))
12565 FOLD_EXPR_PACK (r) = pack;
12568 if (TREE_VEC_LENGTH (pack) == 0)
12571 return expand_left_fold (t, pack, complain);
12583 tree pack = tsubst_fold_expr_pack (t, args, complain, in_decl);
12584 if (pack == error_mark_node)
12590 if (PACK_EXPANSION_P (pack))
12593 FOLD_EXPR_PACK (r) = pack;
12598 tree vec = make_tree_vec (TREE_VEC_LENGTH (pack) + 1);
12600 for (int i = 0; i < TREE_VEC_LENGTH (pack); ++i)
12601 TREE_VEC_ELT (vec, i + 1) = TREE_VEC_ELT (pack, i);
12607 Given a pack containing elementns A0, A1, ..., and an
12617 expand_right_fold (tree t, tree pack, tsubst_flags_t complain)
12620 int n = TREE_VEC_LENGTH (pack);
12621 tree right = TREE_VEC_ELT (pack, n - 1);
12624 tree left = TREE_VEC_ELT (pack, n - 1);
12636 tree pack = tsubst_fold_expr_pack (t, args, complain, in_decl);
12637 if (pack == error_mark_node)
12639 if (PACK_EXPANSION_P (pack))
12642 FOLD_EXPR_PACK (r) = pack;
12645 if (TREE_VEC_LENGTH (pack) == 0)
12648 return expand_right_fold (t, pack, complain);
12660 tree pack = tsubst_fold_expr_pack (t, args, complain, in_decl);
12661 if (pack == error_mark_node)
12667 if (PACK_EXPANSION_P (pack))
12670 FOLD_EXPR_PACK (r) = pack;
12675 int n = TREE_VEC_LENGTH (pack);
12678 TREE_VEC_ELT (vec, i) = TREE_VEC_ELT (pack, i);
12684 /* Walk through the pattern of a pack expansion, adding everything in
12834 /* else inst is already a full instantiation of the pack. */
12858 /* Substitute ARGS into T, which is an pack expansion
12868 tree pack, packs = NULL_TREE;
12887 for (pack = PACK_EXPANSION_PARAMETER_PACKS (t); pack;
12888 pack = TREE_CHAIN (pack))
12890 tree parm_pack = TREE_VALUE (pack);
12913 sorry ("%qE is not the entire pattern of the pack expansion",
12937 /* This parameter pack was used in an unevaluated context. Just
12944 up an argument pack yet. */
12950 /* This argument pack isn't fully instantiated yet. */
12977 pack somewhere else. Just return an error, silently. */
13001 error ("mismatched argument pack lengths while expanding %qT",
13004 error ("mismatched argument pack lengths while expanding %qE",
13016 /* We can't substitute for this parameter pack. We use a flag as
13024 /* If the expansion is just T..., return the matching argument pack, unless
13032 /* If the argument pack is a single pack expansion, pull it out. */
13038 some pack expansion args we won't do anything yet. */
13043 /* Also optimize expression pack expansions if we can tell that the
13076 pack with another version of itself. Substitute into the
13087 /* This is a fake auto... pack expansion created in add_capture with
13090 pack = retrieve_local_specialization (TREE_VALUE (packs));
13091 gcc_checking_assert (DECL_PACK_P (pack));
13093 = build_tree_list (NULL_TREE, pack);
13101 /* For each argument in each argument pack, substitute into the
13121 for (pack = packs; pack; pack = TREE_CHAIN (pack))
13123 tree parm = TREE_PURPOSE (pack);
13128 register_local_specialization (TREE_TYPE (pack), parm);
13133 if (TREE_VALUE (pack) == NULL_TREE)
13141 TREE_TYPE (pack);
13143 TREE_VEC_ELT (args, idx) = TREE_TYPE (pack);
13147 /* If the dependent pack arguments were such that we end up with only a
13148 single pack expansion again, there's no need to keep it in a TREE_VEC. */
13158 parameter packs; all parms generated from a function parameter pack will
13186 /* Make an argument pack out of the TREE_VEC VEC. */
13191 tree pack;
13194 pack = cxx_make_type (TYPE_ARGUMENT_PACK);
13197 pack = make_node (NONTYPE_ARGUMENT_PACK);
13198 TREE_CONSTANT (pack) = 1;
13200 SET_ARGUMENT_PACK_ARGS (pack, vec);
13201 return pack;
13284 measurement, because the argument pack expression
13287 the argument pack is empty. */
13330 /* Now expand the template argument pack "in place". */
14323 parameter pack, it means that we're doing a "simple"
14334 the parameters in this function parameter pack. */
14356 a function parameter pack, LEN is the number of expanded
14368 pack. */
14409 into a function parameter pack. */
14434 /* This field is a lambda capture pack. Return a TREE_VEC of
14888 /* For a pack expansion, perform substitution on the
14900 pack. Our type is TYPE_PACK_EXPANSION. */
15133 /* Expand the pack expansion type. */
15368 /* If ARG is an argument pack, we don't actually want to
15373 parameter pack, when that type actually contains
15605 /* We have pack expansions, so expand those and
15642 the argument pack, we only RETURN (a single list
15919 error ("%qD is instantiated for an empty pack",
16419 pack expansion where the parameter packs
16710 parameter pack expansions. */
17102 error ("invalid use of pack expansion expression");
17106 error ("use %<...%> to expand argument pack");
17938 /* Return the proper local_specialization for init-capture pack DECL. */
17943 /* We handle normal pack captures by forwarding to the specialization of the
17944 captured parameter. We can't do that for pack init-captures; we need them
17947 when we process the DECL_EXPR for the pack init-capture in the template.
17948 So, how do we find them? We don't know the capture proxy pack when
17950 individual proxies when instantiating the pack. What we have in common is
18925 error ("invalid use of pack expansion expression");
18929 error ("use %<...%> to expand argument pack");
19081 instantiation context. Instantiating a pack expansion containing a lambda
19270 tree pack = (*field_packs)[i++];
19272 register_local_specialization (inst, pack);
19854 only happen when the initializer is a pack expansion whose
19988 /* Expand the pack expansion and push each entry onto
20341 /* We have pack expansions, so expand those and
20372 the argument pack, we only RETURN (a single list
20564 /* Substitute into the pack expansion. */
21121 /* PARM is a template parameter pack for FN. Returns true iff
21138 /* The template parameter pack is used in a function parameter
21139 pack. If this is the end of the parameter list, the
21140 template parameter pack is deducible. */
21145 a non-pack parameter, but doing so would end up with
21150 /* The template parameter pack isn't used in any function parameter
21176 /* For a function parameter pack that occurs at the end of the
21179 declarator-id of the function parameter pack. */
21185 /* For a function parameter pack that does not occur at the
21187 parameter pack is a non-deduced context. */
21371 /* Mark the argument pack as "incomplete". We could
22065 /* For a function parameter pack that occurs at the end of the
22068 declarator-id of the function parameter pack. */
22074 /* For a function parameter pack that does not occur at the
22076 parameter pack is a non-deduced context. */
22091 /* Unify the remaining arguments with the pack expansion type. */
22194 /* If the type parameter is a parameter pack, then it will
22195 be deduced to an empty parameter pack. */
22449 /* Don't forget explicit template arguments in a pack. */
22650 /* Check that the argument at each index of the deduced argument pack
22656 that's wrong if we deduce the same argument pack from multiple
22891 /* Unifies the remaining arguments in PACKED_ARGS with the pack
22908 tree pack, packs = NULL_TREE;
22921 for (pack = PACK_EXPANSION_PARAMETER_PACKS (parm);
22922 pack; pack = TREE_CHAIN (pack))
22924 tree parm_pack = TREE_VALUE (pack);
22932 /* Determine the index and level of this parameter pack. */
22951 /* For each parameter pack, set its TMPL_ARG to either NULL_TREE
22952 or the element of its argument pack at the current index if
22954 for (pack = packs; pack; pack = TREE_CHAIN (pack))
22958 template_parm_level_and_index (TREE_PURPOSE (pack), &level, &idx);
22961 if (TREE_VALUE (pack)
22962 && (pargs = ARGUMENT_PACK_EXPLICIT_ARGS (TREE_VALUE (pack)))
22997 /* For each parameter pack, collect the deduced value. */
22998 for (pack = packs; pack; pack = TREE_CHAIN (pack))
23001 template_parm_level_and_index (TREE_PURPOSE (pack), &level, &idx);
23003 TREE_VEC_ELT (TREE_TYPE (pack), i - start) =
23011 for (pack = packs; pack; pack = TREE_CHAIN (pack))
23013 tree old_pack = TREE_VALUE (pack);
23014 tree new_args = TREE_TYPE (pack);
23019 /* By default keep the original deduced argument pack.
23022 template_parm_level_and_index (TREE_PURPOSE (pack), &level, &idx);
23047 if (TREE_CODE (TREE_PURPOSE (pack)) == TEMPLATE_PARM_INDEX)
23058 pack. */
23080 /* Inconsistent unification of this parameter pack. */
23487 /* If ARG is a parameter pack or an expansion, we cannot unify
23488 against it unless PARM is also a parameter pack. */
23597 /* If ARG is a parameter pack or an expansion, we cannot unify
23598 against it unless PARM is also a parameter pack. */
23717 /* Check for pack expansions in the parameters. */
23724 parameter pack. */
23728 P contains a pack expansion that is not the last
23736 (not counting the pack expression at the end), or we have
23738 a pack expression, we can't unify. */
23745 pack expression. */
24225 /* When both arguments are pack expansions, we need only
24279 a pack expansion but ARG2 is not. */
24303 a pack expansion but ARG1 is not.*/
24309 /* The normal case, where neither argument is a pack
24367 handing of the pack expansion type. */
24408 /* All things being equal, if the next argument is a pack expansion
24480 has a parameter pack at the end, the template with the most
24492 /* We don't count the pack expansion at the end. */
24757 template friend, or a FIELD_DECL for a capture pack. */
25329 pack. */
25335 the parameters in this function parameter pack. */
25630 /* Register the (value) argument pack as a specialization of
26267 the initializer was a pack expansion where the parameter
26580 /* A template argument pack is dependent if any of its packed
26828 type-dependent or is a pack expansion. */
27533 /* Look inside the argument pack. */
29674 /* Create a distinct parameter pack type from the current parm and add it
29690 /* Replace the current template parameter with new pack. */
29725 /* __integer_pack(N) in a pack expansion expands to a sequence of numbers from