re PR c++/78018 ([C++14] "internal compiler error: Segmentation fault" with templates...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 4 Oct 2017 20:34:03 +0000 (20:34 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 4 Oct 2017 20:34:03 +0000 (20:34 +0000)
2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/78018
* g++.dg/cpp1y/lambda-generic-78018.C: New.

From-SVN: r253430

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/lambda-generic-78018.C [new file with mode: 0644]

index 8e00f3274c00cf095a6c06b857dc58d46961f6de..6e8680b3312f121364461c224cca29ba4f3dd749 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/78018
+       * g++.dg/cpp1y/lambda-generic-78018.C: New.
+
 2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
            Andrew Pinski  <apinski@cavium.com>
 
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-78018.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-78018.C
new file mode 100644 (file)
index 0000000..6cf9c59
--- /dev/null
@@ -0,0 +1,37 @@
+// PR c++/78018
+// { dg-do compile { target c++14 } }
+
+struct A
+{
+    void f1();
+
+    template <typename F>
+    void f2(F f);
+
+    template<typename T>
+    void f3(T t);
+};
+
+struct B
+{
+    template<typename L>
+    void f(L) { }
+};
+
+void A::f1()
+{
+    f2([&] (auto t) { f3(t); } );
+}
+
+template <typename F>
+void A::f2(F f)
+{
+    B b;
+    f(b);
+}
+
+template<typename T>
+void A::f3(T t)
+{
+}
+