Files
gcc-reflection/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda18.C
Marek Polacek be515b4ce0 *.C: Use target c++17 instead of explicit dg-options.
* g++.dg/*.C: Use target c++17 instead of explicit dg-options.
	* lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
	the list of default stds to test.

From-SVN: r265343
2018-10-20 17:21:19 +00:00

31 lines
391 B
C

// PR c++/82570
// { dg-do compile { target c++17 } }
template< typename Body >
inline void iterate(Body body)
{
body(10);
}
template< typename Pred >
inline void foo(Pred pred)
{
iterate([&](int param)
{
if (pred(param))
{
unsigned char buf[4];
buf[0] = 0;
buf[1] = 1;
buf[2] = 2;
buf[3] = 3;
}
});
}
int main()
{
foo([](int x) { return x > 0; });
return 0;
}