+2015-11-03 Jason Merrill <jason@redhat.com>
+
+ * pt.c (struct find_parameter_pack_data): Add
+ type_pack_expansion_p field.
+ (find_parameter_packs_r): Use it to turn 'auto' into a parameter pack.
+ (uses_parameter_packs, make_pack_expansion)
+ (check_for_bare_parameter_packs, fixed_parameter_pack_p): Set it.
+
2015-11-03 Thomas Schwinge <thomas@codesourcery.com>
Chung-Lin Tang <cltang@codesourcery.com>
/* Set of AST nodes that have been visited by the traversal. */
hash_set<tree> *visited;
+
+ /* True iff we're making a type pack expansion. */
+ bool type_pack_expansion_p;
};
/* Identifies all of the argument packs that occur in a template
case TEMPLATE_TYPE_PARM:
t = TYPE_MAIN_VARIANT (t);
case TEMPLATE_TEMPLATE_PARM:
+ /* If the placeholder appears in the decl-specifier-seq of a function
+ parameter pack (14.6.3), or the type-specifier-seq of a type-id that
+ is a pack expansion, the invented template parameter is a template
+ parameter pack. */
+ if (ppd->type_pack_expansion_p && is_auto_or_concept (t))
+ TEMPLATE_TYPE_PARAMETER_PACK (t) = true;
if (TEMPLATE_TYPE_PARAMETER_PACK (t))
parameter_pack_p = true;
break;
struct find_parameter_pack_data ppd;
ppd.parameter_packs = ¶meter_packs;
ppd.visited = new hash_set<tree>;
+ ppd.type_pack_expansion_p = false;
cp_walk_tree (&t, &find_parameter_packs_r, &ppd, ppd.visited);
delete ppd.visited;
return parameter_packs != NULL_TREE;
/* Determine which parameter packs will be expanded. */
ppd.parameter_packs = ¶meter_packs;
ppd.visited = new hash_set<tree>;
+ ppd.type_pack_expansion_p = TYPE_P (arg);
cp_walk_tree (&arg, &find_parameter_packs_r, &ppd, ppd.visited);
delete ppd.visited;
ppd.parameter_packs = ¶meter_packs;
ppd.visited = new hash_set<tree>;
+ ppd.type_pack_expansion_p = false;
cp_walk_tree (&t, &find_parameter_packs_r, &ppd, ppd.visited);
delete ppd.visited;
struct find_parameter_pack_data ppd;
ppd.parameter_packs = ¶meter_packs;
ppd.visited = new hash_set<tree>;
+ ppd.type_pack_expansion_p = false;
fixed_parameter_pack_p_1 (parm, &ppd);