re PR c++/47226 ([C++0x] GCC doesn't expand template parameter pack that appears...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 13 Sep 2017 09:47:11 +0000 (09:47 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 13 Sep 2017 09:47:11 +0000 (09:47 +0000)
2017-09-13  Paolo Carlini  <paolo.carlini@oracle.com>

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
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic5.C [new file with mode: 0644]

index c0b0e9ac232f8dcf3ae619badbd231fab09107df..c7d26d6630241b0fdbf158b5b17a8535fd3de497 100644 (file)
@@ -1,3 +1,9 @@
+2017-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/47226
+       * g++.dg/cpp0x/lambda/lambda-variadic4.C: New.
+       * g++.dg/cpp0x/lambda/lambda-variadic5.C: Likewise.
+
 2017-09-13  Richard Biener  <rguenther@suse.de>
 
        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 (file)
index 0000000..ada25b3
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/47226
+// { dg-do compile { target c++11 } }
+
+void slurp(...) { } 
+template<int ...N> 
+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 (file)
index 0000000..5196a18
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/47226
+// { dg-do compile { target c++11 } }
+
+template<class T>
+void print(const T&) {}
+
+template<class... T>
+void accept_all(T&&...){}
+
+template<class... T>
+void print_all(const T&... t)
+{
+  accept_all([&]()->int { print(t); return 0; }...);
+}
+
+int main()
+{
+  print_all(1, true, 'a');
+}