https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94546
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:aedd04caa945260ea77fd22f29b77292f7dba72e commit r10-7865-gaedd04caa945260ea77fd22f29b77292f7dba72e Author: Jason Merrill <ja...@redhat.com> Date: Wed Apr 22 02:27:54 2020 -0400 c++: generic lambda forwarding function [PR94546] While instantiating test(Plot) we partially instantiate the generic lambda. We look at forward<T>(rest)... and see that it's just replacing parameter packs with new parameter packs and tries to do a direct substitution. But because register_parameter_specializations had built up a NONTYPE_ARGUMENT_PACK around the new parameter pack, the substitution failed. So let's not wrap it that way. gcc/cp/ChangeLog 2020-04-22 Jason Merrill <ja...@redhat.com> PR c++/94546 * pt.c (register_parameter_specializations): If the instantiation is still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK. (tsubst_pack_expansion, tsubst_expr): Adjust.