From 968e56bf7f0a064fdc234a6b13246b02724a6d4a Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 4 Oct 2017 20:34:03 +0000 Subject: [PATCH] re PR c++/78018 ([C++14] "internal compiler error: Segmentation fault" with templates and lambdas) 2017-10-04 Paolo Carlini PR c++/78018 * g++.dg/cpp1y/lambda-generic-78018.C: New. From-SVN: r253430 --- gcc/testsuite/ChangeLog | 5 +++ .../g++.dg/cpp1y/lambda-generic-78018.C | 37 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-78018.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e00f3274c0..6e8680b3312 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-04 Paolo Carlini + + PR c++/78018 + * g++.dg/cpp1y/lambda-generic-78018.C: New. + 2017-10-04 Paolo Carlini Andrew Pinski 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 index 00000000000..6cf9c5966cd --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-78018.C @@ -0,0 +1,37 @@ +// PR c++/78018 +// { dg-do compile { target c++14 } } + +struct A +{ + void f1(); + + template + void f2(F f); + + template + void f3(T t); +}; + +struct B +{ + template + void f(L) { } +}; + +void A::f1() +{ + f2([&] (auto t) { f3(t); } ); +} + +template +void A::f2(F f) +{ + B b; + f(b); +} + +template +void A::f3(T t) +{ +} + -- 2.30.2