From 3baeecac5fbccd8f32e0a2938290693aa18264ac Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 10 Jul 2015 02:44:39 +0000 Subject: [PATCH] re PR c++/64848 (G++ internal compiler error with templated lambdas capturing variable) 2015-07-09 Paolo Carlini PR c++/64848 * g++.dg/cpp0x/lambda/lambda-ice14.C: New. From-SVN: r225648 --- gcc/testsuite/ChangeLog | 5 +++ .../g++.dg/cpp0x/lambda/lambda-ice14.C | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice14.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df74648deff..abdf8177898 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-07-09 Paolo Carlini + + PR c++/64848 + * g++.dg/cpp0x/lambda/lambda-ice14.C: New. + 2015-07-09 Jakub Jelinek PR middle-end/66633 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice14.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice14.C new file mode 100644 index 00000000000..77203794133 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice14.C @@ -0,0 +1,32 @@ +// PR c++/64848 +// { dg-do compile { target c++11 } } + +template +struct function; + +template +struct function +{ + template + function(const F&); +}; + +template +class A +{ + T someVar; +}; + +template +class B +{ + int x; + + function(A&)> someLambda = [&](A& aInt){ + int xVar = x; + A aRet; + return aRet; + }; +}; + +B a; -- 2.30.2