From 1a6da556c414bbbec6df82fdb342e8b84e205507 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 2 Oct 2017 09:41:36 +0000 Subject: [PATCH] re PR c++/69977 (internal compiler error: Segmentation fault when using generic lambdas) 2017-10-02 Paolo Carlini PR c++/69977 * g++.dg/cpp1y/lambda-generic-69977.C: New. From-SVN: r253340 --- gcc/testsuite/ChangeLog | 5 ++++ .../g++.dg/cpp1y/lambda-generic-69977.C | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-69977.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bd060dfb252..1edc61ee2f4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-02 Paolo Carlini + + PR c++/69977 + * g++.dg/cpp1y/lambda-generic-69977.C: New. + 2017-10-02 Paolo Carlini 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 index 00000000000..5f491da894b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-69977.C @@ -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(); +} -- 2.30.2