This was a wrong code issue where we printed 2 3 1 1 2 3 instead of 1 2 3 1 2 3 but it was fixed by r271705. I don't know of a good way to check the auto... expansion here so I used dg-output.
Tested on x86_64-linux, ok for trunk? 2019-07-17 Marek Polacek <pola...@redhat.com> PR c++/91104 * g++.dg/cpp1y/lambda-generic-variadic20.C: New test. --- /dev/null +++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic20.C @@ -0,0 +1,20 @@ +// PR c++/91104 +// { dg-do run { target c++14 } } + +#include <cstdio> + +void test(void (*f)(int, int, int)) { + f(1, 2, 3); +} + +int main() { + test([](auto... args) { + printf("%d %d %d\n", args...); + }); + test([](int a, int b, int c) { + printf("%d %d %d\n", a, b, c); + }); +} + +// { dg-output "1 2 3(\n|\r\n|\r)" } +// { dg-output "\[^\n\r]*1 2 3" }