re PR c++/69977 (internal compiler error: Segmentation fault when using generic lambdas)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 2 Oct 2017 09:41:36 +0000 (09:41 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 2 Oct 2017 09:41:36 +0000 (09:41 +0000)
2017-10-02  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r253340

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

index bd060dfb2522ed1d9ac9d023c05862d6b35905e0..1edc61ee2f46cb7c31fb5c3288ad670cd055c3ac 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-02  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/69977
+       * g++.dg/cpp1y/lambda-generic-69977.C: New.
+
 2017-10-02  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/59991
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-69977.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-69977.C
new file mode 100644 (file)
index 0000000..5f491da
--- /dev/null
@@ -0,0 +1,23 @@
+// PR c++/69977
+// { dg-do compile { target c++14 } }
+
+class A {
+private:
+    void method(int i) {
+        (void) i;
+    }
+
+public:
+    void publicMethod() {
+        auto lambda = [&] (const auto k) {
+            method(k);
+        };
+        lambda(42);
+    }
+};
+
+int main()
+{
+    A a;
+    a.publicMethod();
+}