Sign in
gnu
/
gcc
/
a6d3012b274f38b20e2a57162106f625746af6c6
/
.
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
lambda-init4.C
blob: 787ffc0476d6d8e96409703802d20b137a58966a [
file
] [
log
] [
blame
]
// N3648: capture init example from paper
// { dg-do run { target c++14 } }
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
();
}