Rebase.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-return1.C
blob4b353b64c37e78c1d123db28863701c2413f9569
1 // PR c++/57437
2 // { dg-require-effective-target c++11 }
4 struct A {
5   int i;
7   A(): i(42) {}
8   A(const A&) = default;
9   A(A&& a): i(a.i) { a.i = 0; }
12 int main()
14   A x;
16   auto y = [x] () mutable {
17     x.i++;
18     return x;
19   };
21   if (y().i != 43)
22     __builtin_abort ();
24   if (y().i != 44)
25     __builtin_abort ();