The following code snippet... template <int... Is> void foo() { ([i = Is]{}(), ...); } ...does not compile on gcc trunk 20180408 with the following error: <source>: In function 'void foo()': <source>:4:11: error: parameter packs not expanded with '...': ([i = Is]{}(), ...); ^~ <source>:4:11: note: 'Is' <source>:4:16: error: operand of fold expression has no unexpanded parameter packs ([i = Is]{}(), ...); ~~~~~~~~~~^~ Live example on godbolt.org: https://godbolt.org/g/YBk6L6
Author: jason Date: Mon Apr 30 21:21:25 2018 New Revision: 259779 URL: https://gcc.gnu.org/viewcvs?rev=259779&root=gcc&view=rev Log: PR c++/85305 - pack in lambda init-capture. * parser.c (cp_parser_initializer): Add subexpression_p parm; don't check_for_bare_parameter_packs in a subexpression. (cp_parser_lambda_introducer): Use it. Added: trunk/gcc/testsuite/g++.dg/cpp1z/fold-lambda2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c
Fixed on trunk so far.
Author: jason Date: Fri May 4 20:20:16 2018 New Revision: 259959 URL: https://gcc.gnu.org/viewcvs?rev=259959&root=gcc&view=rev Log: PR c++/85305 - pack in lambda init-capture. * parser.c (cp_parser_initializer): Add subexpression_p parm; don't check_for_bare_parameter_packs in a subexpression. (cp_parser_lambda_introducer): Use it. Added: branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp1z/fold-lambda2.C Modified: branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/parser.c
Fixed for 8.2.