Implement P0780R2, pack expansion in lambda init-capture.
authorJason Merrill <jason@redhat.com>
Tue, 13 Nov 2018 04:34:59 +0000 (23:34 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 13 Nov 2018 04:34:59 +0000 (23:34 -0500)
commit7de37c97b4031ba61c867cf6fadf63916c666894
treefdac1a45bf4f122160441c7d94517023f003fdf0
parent16e723e600a62428b8ed6ab414931ec7a78aceee
Implement P0780R2, pack expansion in lambda init-capture.

Mostly this was straightforward; the tricky bit was finding, in the
instantiation, the set of capture proxies built when instantiating the
init-capture.  The comment in lookup_init_capture_pack goes into detail.

* parser.c (cp_parser_lambda_introducer): Parse pack init-capture.
* pt.c (tsubst_pack_expansion): Handle init-capture packs.
(lookup_init_capture_pack): New.
(tsubst_expr) [DECL_EXPR]: Use it.
(tsubst_lambda_expr): Remember field pack expansions for
init-captures.

From-SVN: r266052
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C [new file with mode: 0644]