c++: Diagnose bogus variadic lambda. [PR97358]
authorJason Merrill <jason@redhat.com>
Wed, 14 Oct 2020 18:55:04 +0000 (14:55 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 14 Oct 2020 19:44:29 +0000 (15:44 -0400)
commit270c5a982ccb4ef83bd9ad37d39cf47461acb55a
tree47903886f6b3ced46462dd0d088f76f59d1c4a9c
parent8f8cba46b89ad16bac2ce58d554c25b54b0e7c7f
c++: Diagnose bogus variadic lambda. [PR97358]

If the lambda has a capture pack, it cannot be used unexpanded within the
body of the lambda.  If you want to expand the pack across multiple lambdas,
don't capture the whole pack.

gcc/cp/ChangeLog:

PR c++/97358
* pt.c (check_for_bare_parameter_packs): Diagnose use of
capture pack.

gcc/testsuite/ChangeLog:

PR c++/97358
* g++.dg/cpp0x/lambda/lambda-variadic11.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic11.C [new file with mode: 0644]