re PR c++/67838 (Rejects-valid-code: templated lambda variable.)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 22 Oct 2015 14:55:14 +0000 (14:55 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 22 Oct 2015 14:55:14 +0000 (14:55 +0000)
2015-10-22  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/67838
* g++.dg/cpp1y/var-templ46.C: New.

From-SVN: r229175

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/var-templ46.C [new file with mode: 0644]

index 2ea3d941331856f8ab818e59201e4cada4336c11..be7d83bbc16013836b2ba782087c6e09fcbfc5c7 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-22  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/67838
+       * g++.dg/cpp1y/var-templ46.C: New.
+
 2015-10-22  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/58497
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ46.C b/gcc/testsuite/g++.dg/cpp1y/var-templ46.C
new file mode 100644 (file)
index 0000000..2fb3453
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/67838
+// { dg-do compile { target c++14 } }
+
+template<bool LMode>
+static auto TestFunc = [](int param1)
+{
+    return param1;
+};
+
+template<typename Func>
+static void test(Func func)
+{
+    func(12345);
+}
+
+int main()
+{
+    test(TestFunc<false>);
+    test(TestFunc<true>);
+}