https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102629
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:f0484f60e6409ef6e837e4712d212a5d827767ba commit r11-9988-gf0484f60e6409ef6e837e4712d212a5d827767ba Author: Jason Merrill <ja...@redhat.com> Date: Tue Apr 26 00:19:40 2022 -0400 c++: pack init-capture of unresolved overload [PR102629] Here we were failing to diagnose that the initializer for the capture pack is an unresolved overload. It turns out that the reason we didn't recognize the deduction failure in do_auto_deduction was that the individual 'auto' in the expansion of the capture pack was still marked as a parameter pack, so we were deducing it to an empty pack instead of failing. PR c++/102629 gcc/cp/ChangeLog: * pt.c (gen_elem_of_pack_expansion_instantiation): Clear TEMPLATE_TYPE_PARAMETER_PACK on auto. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/lambda-pack-init7.C: New test.