From b6509175b2602b0f7c4515b86e350e6cba42c603 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 13 Sep 2017 19:22:55 +0000 Subject: [PATCH] re PR c++/68177 (Lambda capture doesn't work correctly when lambda is used in a pack expansion) 2017-09-13 Paolo Carlini PR c++/68177 * g++.dg/cpp0x/lambda/lambda-68177.C: New. From-SVN: r252732 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-68177.C | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-68177.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4084e1c39e8..7fb8ec16b8e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-09-13 Paolo Carlini + + PR c++/68177 + * g++.dg/cpp0x/lambda/lambda-68177.C: New. + 2017-09-13 Martin Liska PR middle-end/82154 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-68177.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-68177.C new file mode 100644 index 00000000000..036f2eaf753 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-68177.C @@ -0,0 +1,16 @@ +// { dg-do compile { target c++11 } } + +void swallow(...) {} +template +void foo() { + int t = 0; + swallow( + ([&t]{return 0;}(), Is)... + ); +} + +int main() +{ + foo<1, 2>(); + return 0; +} -- 2.30.2