Implement P0780R2, pack expansion in lambda init-capture

Programming / Compilers / GCC - jason [138bc75d-0d04-0410-961f-82ee72b054a4] - 13 November 2018 04:34 EST

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.

e771eb36d40 Implement P0780R2, pack expansion in lambda init-capture.
gcc/cp/ChangeLog | 8 +++
gcc/cp/parser.c | 13 ++++
gcc/cp/pt.c | 93 +++++++++++++++++++++++---
gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C | 17 +++++
4 files changed, 120 insertions(+), 11 deletions(-)

Upstream: gcc.gnu.org


  • Share