/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-ice25.C
blob1a33fb1636447b83644950b29bff93cf1ce9aa73
1 // PR c++/83204
2 // { dg-do compile { target c++11 } }
4 int rand();
6 template<typename T>
7 struct s
9     int count() { return rand(); }
12 template<typename v>
13 void f(s<v> a)
15     int const x = a.count();
16     int r = 0;
17     auto l = [&](int& r)
18     {
19         for(int y = 0, yend = (x); y < yend; ++y)
20         {
21             r += y;
22         }
23     };
24     l(r);
27 template void f(s<float>);