2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / constexpr-lambda18.C
blobc7ef8d0752e8ef3553b5c44050dc9bf3702bcb51
1 // PR c++/82570
2 // { dg-do compile { target c++17 } }
4 template< typename Body >
5 inline void iterate(Body body)
7         body(10);
10 template< typename Pred >
11 inline void foo(Pred pred)
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         });
26 int main()
28         foo([](int x) { return x > 0; });
29         return 0;