For non-type parameter packs when unifying the arguments in
unify_pack_expansion it iterates over the associated packs of a param so
that when it recursively unifies the param with the arguments it knows
which targs have been populated with parameter pack arguments that it can
then collect up. This change adds a tree walk so that in the example above
it reaches ...A and adds it to the associated packs for ...B and therefore
knows it will have been set in targs in unify_pack_expansion and processes
it as per other pack arguments.
PR c++/118265
gcc/cp/ChangeLog:
* pt.cc (find_parameter_packs_r) <case TEMPLATE_PARM_INDEX>:
Walk into the type of a parameter pack.
Signed-off-by: Adam J Ryan <gcc.gnu.org@ajryansolutions.co.uk>
&find_parameter_packs_r, ppd, ppd->visited);
return NULL_TREE;
+ case TEMPLATE_PARM_INDEX:
+ if (parameter_pack_p)
+ WALK_SUBTREE (TREE_TYPE (t));
+ return NULL_TREE;
+
case DECL_EXPR:
{
tree decl = DECL_EXPR_DECL (t);
--- /dev/null
+// { dg-do compile { target c++17 } }
+struct Class1
+{
+ void apply_bool(bool){}
+ void apply_char(char){}
+};
+
+template<auto...Fn> struct Class2;
+template<typename...P, void(Class1::*...Fn)(P)> struct Class2<Fn...>
+{
+ void apply(){}
+};
+
+int main()
+{
+ Class2<&Class1::apply_bool, &Class1::apply_char> class2;
+ class2.apply ();
+}