Sign in
chromium
/
chromiumos
/
third_party
/
gcc
/
refs/heads/factory-ryu-6486.B
/
.
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
lambda-init4.C
blob: 0affb31bd5eda78c86229bb1dc309759c66c1b54 [
file
] [
log
] [
blame
]
// N3648: capture init example from paper
// { dg-do run { target c++1y } }
int
x
=
4
;
auto
y
=
[&
r
=
x
,
x
=
x
+
1
]()->
int
{
r
+=
2
;
return
x
+
2
;
}();
// Updates ::x to 6, and initializes y to 7.
int
main
()
{
if
(
x
!=
6
||
y
!=
7
)
__builtin_abort
();
}