From: Marek Polacek Date: Thu, 25 Jun 2020 23:04:06 +0000 (-0400) Subject: c++: Add test for c++/91104 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08ca2d744d50d0d5a341530031e6bbb82831109f;p=gcc.git c++: Add test for c++/91104 Fixed by r271705. gcc/testsuite/ChangeLog: PR c++/91104 * g++.dg/cpp1y/lambda-generic-variadic21.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic21.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic21.C new file mode 100644 index 00000000000..affb1ffd474 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic21.C @@ -0,0 +1,26 @@ +// PR c++/91104 +// { dg-do run { target c++14 } } + +void +test (void (*f)(int, int, int)) +{ + f(1, 2, 3); +} + +void +check (int a, int b, int c) +{ + if (a != 1 || b != 2 || c != 3) + __builtin_abort (); +} + +int +main () +{ + test ([](auto... args) { + check (args...); + }); + test ([](int a, int b, int c) { + check (a, b, c); + }); +}