repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Rebase.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
lambda
/
lambda-return1.C
blob
4b353b64c37e78c1d123db28863701c2413f9569
1
// PR c++/57437
2
// { dg-require-effective-target c++11 }
3
4
struct A {
5
int i;
6
7
A(): i(42) {}
8
A(const A&) = default;
9
A(A&& a): i(a.i) { a.i = 0; }
10
};
11
12
int main()
13
{
14
A x;
15
16
auto y = [x] () mutable {
17
x.i++;
18
return x;
19
};
20
21
if (y().i != 43)
22
__builtin_abort ();
23
24
if (y().i != 44)
25
__builtin_abort ();
26
}