1 // PR c++/82570
2 // { dg-options "-std=c++17" }
3 
4 template< typename Body >
iterate(Body body)5 inline void iterate(Body body)
6 {
7 	body(10);
8 }
9 
10 template< typename Pred >
foo(Pred pred)11 inline void foo(Pred pred)
12 {
13 	iterate([&](int param)
14 	{
15 		if (pred(param))
16 		{
17 			unsigned char buf[4];
18 			buf[0] = 0;
19 			buf[1] = 1;
20 			buf[2] = 2;
21 			buf[3] = 3;
22 		}
23 	});
24 }
25 
main()26 int main()
27 {
28 	foo([](int x) { return x > 0; });
29 	return 0;
30 }
31