re PR c++/68177 (Lambda capture doesn't work correctly when lambda is used in a pack...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 13 Sep 2017 19:22:55 +0000 (19:22 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 13 Sep 2017 19:22:55 +0000 (19:22 +0000)
2017-09-13  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/68177
* g++.dg/cpp0x/lambda/lambda-68177.C: New.

From-SVN: r252732

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-68177.C [new file with mode: 0644]

index 4084e1c39e88c0804b07cef9c4155d10df9bafd5..7fb8ec16b8e5562dbbf2eac2ce5ce7f3ef733155 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/68177
+       * g++.dg/cpp0x/lambda/lambda-68177.C: New.
+
 2017-09-13  Martin Liska  <mliska@suse.cz>
 
        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 (file)
index 0000000..036f2ea
--- /dev/null
@@ -0,0 +1,16 @@
+// { dg-do compile { target c++11 } }
+
+void swallow(...) {}
+template<int... Is>
+void foo() {
+  int t = 0;
+  swallow(
+   ([&t]{return 0;}(), Is)...
+  );
+}
+
+int main()
+{
+  foo<1, 2>();
+  return 0;
+}