From caf3dcdf25eb77b655d7bdf8e55fff3eacd487f8 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 13 Sep 2017 09:47:11 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic4.C | 11 +++++++++++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic5.C | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic4.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic5.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c0b0e9a..c7d26d6 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 0000000..ada25b3 --- /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 0000000..5196a18 --- /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'); +} -- 2.7.4