From: Paolo Carlini Date: Mon, 2 Oct 2017 21:44:55 +0000 (+0000) Subject: re PR c++/79005 (Use of a captured variable within nested generic lambdas provokes... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=603841eb29cac36e672890f63c0ee8a80d4829c2;p=gcc.git re PR c++/79005 (Use of a captured variable within nested generic lambdas provokes internal compiler error.) 2017-10-02 Paolo Carlini PR c++/79005 * g++.dg/cpp1y/lambda-generic-79005.C: New. From-SVN: r253368 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8c513943392..e678265bdd0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-02 Paolo Carlini + + PR c++/79005 + * g++.dg/cpp1y/lambda-generic-79005.C: New. + 2017-10-02 Paul Thomas PR fortran/82312 diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-79005.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-79005.C new file mode 100644 index 00000000000..79b89ca80cb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-79005.C @@ -0,0 +1,21 @@ +// PR c++/79005 +// { dg-do compile { target c++14 } } + +int main() +{ + auto glambda = [] (auto a) + { + const int c = a; + auto cglambda = [&] ( auto b ) + { + double result; + result = b * a; + result = b * c; + return result; + }; + cglambda ( 1 ); + a = c; + }; + + glambda( 1 ); +}