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();
}