From: Jason Merrill Date: Tue, 23 Jan 2018 21:24:01 +0000 (-0500) Subject: * g++.dg/cpp1y/lambda-generic.C: Remove libstdc++ dependency. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea070f267ce83116b86cf771d508d8420de8afe0;p=gcc.git * g++.dg/cpp1y/lambda-generic.C: Remove libstdc++ dependency. From-SVN: r257001 --- diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic.C index 9bd744c362c..144f9e95f6d 100644 --- a/gcc/testsuite/g++.dg/cpp1y/lambda-generic.C +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic.C @@ -1,22 +1,23 @@ // Generic lambda test from N3690 5.1.2.5 // { dg-do compile { target c++14 } } -#include +struct A { } cout; +template A& operator<<(A& a, T); int main() { auto glambda = [](auto a, auto&& b) { return a < b; }; bool b = glambda(3, 3.14); // OK auto vglambda = [](auto printer) { - return [=](auto&& ... ts) { // OK: ts is a function parameter pack - printer(std::forward(ts)...); + return [=](auto ... ts) { // OK: ts is a function parameter pack + printer(ts ...); return [=]() { printer(ts ...); }; }; }; auto p = vglambda( [](auto v1, auto v2, auto v3) - { std::cout << v1 << v2 << v3; } ); + { cout << v1 << v2 << v3; } ); auto q = p(1, 'a', 3.14); // OK: outputs 1a3.14 q(); // OK: outputs 1a3.14 }