From: Paolo Carlini Date: Thu, 5 Mar 2015 08:48:22 +0000 (+0000) Subject: re PR c++/64834 (Captured variable not available in unevaluated context in a lambda... X-Git-Tag: releases/gcc-5.1.0~601 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=637e43b8e1b2d18f51f6d18714cb794717ced3c4;p=thirdparty%2Fgcc.git re PR c++/64834 (Captured variable not available in unevaluated context in a lambda with auto argument) 2015-03-05 Paolo Carlini PR c++/64834 * g++.dg/cpp1y/lambda-generic-uneval1.C: New. From-SVN: r221205 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a16501a222d0..937afa58a366 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-05 Paolo Carlini + + PR c++/64834 + * g++.dg/cpp1y/lambda-generic-uneval1.C: New. + 2015-03-04 Eric Botcazou * gnat.dg/entry_queues3.adb: New test. diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-uneval1.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-uneval1.C new file mode 100644 index 000000000000..113eacf843cc --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-uneval1.C @@ -0,0 +1,17 @@ +// PR c++/64834 +// { dg-do compile { target c++14 } } + +template +void e(F f) +{ + f(1); +} + +template +void bar() { + int x; + e([&] (const int& y) { (void)sizeof(x); }); + e([&] (const auto& y) { (void)sizeof(x); }); +} + +void baz() { bar<1>(); }