Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- This fixes FAIL: g++.dg/cpp0x/lambda/lambda-decltype3.C -std=c++11 (test for excess errors) due to lambda-decltype3.C:25:6: error: lambda capture initializers only available with '-std=c++14' or '-std=gnu++14' [-Wc++14-extensions]
gcc/testsuite/ChangeLog: * g++.dg/cpp0x/lambda/lambda-decltype3.C: Check __cpp_init_captures. --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C index 7fc157aefb5..2e06e496140 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype3.C @@ -21,8 +21,10 @@ void f() { [=] { [](decltype((x)) y) {}; // OK, lambda takes a parameter of type float const& +#if __cpp_init_captures [x=1](decltype((x)) y) { decltype((x)) z = x; // OK, y has type int&, z has type int const& }; +#endif }; } base-commit: e0c1476d5d7c450b1b16a40364cea4e91237ea93 -- 2.41.0