From: Paolo Carlini Date: Wed, 13 Sep 2017 09:47:11 +0000 (+0000) Subject: re PR c++/47226 ([C++0x] GCC doesn't expand template parameter pack that appears... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=caf3dcdf25eb77b655d7bdf8e55fff3eacd487f8;p=gcc.git re PR c++/47226 ([C++0x] GCC doesn't expand template parameter pack that appears in a lambda-expression) 2017-09-13 Paolo Carlini PR c++/47226 * g++.dg/cpp0x/lambda/lambda-variadic4.C: New. * g++.dg/cpp0x/lambda/lambda-variadic5.C: Likewise. From-SVN: r252064 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c0b0e9ac232..c7d26d66302 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-09-13 Paolo Carlini + + PR c++/47226 + * g++.dg/cpp0x/lambda/lambda-variadic4.C: New. + * g++.dg/cpp0x/lambda/lambda-variadic5.C: Likewise. + 2017-09-13 Richard Biener PR middle-end/82128 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic4.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic4.C new file mode 100644 index 00000000000..ada25b3c0dc --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic4.C @@ -0,0 +1,11 @@ +// PR c++/47226 +// { dg-do compile { target c++11 } } + +void slurp(...) { } +template +void print() { + slurp([]() -> int { + (void) N; // or something fancy... + return 0; + }() ...); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic5.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic5.C new file mode 100644 index 00000000000..5196a18b5f1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic5.C @@ -0,0 +1,19 @@ +// PR c++/47226 +// { dg-do compile { target c++11 } } + +template +void print(const T&) {} + +template +void accept_all(T&&...){} + +template +void print_all(const T&... t) +{ + accept_all([&]()->int { print(t); return 0; }...); +} + +int main() +{ + print_all(1, true, 'a'); +}