Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice25.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
rev | line source |
---|---|
131 | 1 // PR c++/83204 |
2 // { dg-do compile { target c++11 } } | |
3 | |
4 int rand(); | |
5 | |
6 template<typename T> | |
7 struct s | |
8 { | |
9 int count() { return rand(); } | |
10 }; | |
11 | |
12 template<typename v> | |
13 void f(s<v> a) | |
14 { | |
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); | |
25 } | |
26 | |
27 template void f(s<float>); |