PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / obj-c++.dg / lambda-0.mm
blob41482fdba88a9fc2737c008f75494a0a63d4bbc3
1 // Contributed by Iain Sandoe <iain@codesourcery.com>, December 2014.  */
2 // { dg-do compile }
3 // { dg-options "-std=c++11" }
6 template<class Function>
7 Function thing(Function fn, int a)
9   fn(a);
10   return fn;
13 int
14 test (int *arr, unsigned n)
16   int total = 0;
17   for (unsigned i=0; i<n; i++) {
18     int a = arr[i];
19     thing ([&total] (int a) { total += a; }, a);
20   }
21   return total;