c++: lambda pack init-capture within generic lambda
We represent the type of a pack init-capture as auto... with packs from the
initializer stuck into PACK_EXPANSION_PARAMETER_PACKS so that expanding it
produces the right number of elements. But when partially instantiating the
auto..., we were changing PACK_EXPANSION_PARAMETER_PACKS to refer to only
the auto itself. Fixed thus.
gcc/cp/ChangeLog:
PR c++/97938
* cp-tree.h (PACK_EXPANSION_AUTO_P): New.
* lambda.c (add_capture): Set it.
* pt.c (tsubst_pack_expansion): Handle it.
gcc/testsuite/ChangeLog:
PR c++/97938
* g++.dg/cpp2a/lambda-pack-init6.C: New test.