$ bin/clang-repl
clang-repl> int state = 0;
clang-repl> auto toggle = [&]() { return state; };
In file included from <<< inputs >>>:1:
input_line_2:1:16: error: non-local lambda expression cannot have a capture-default
1 | auto toggle = [&]() { return state; };
| ^
error: Parsing failed.
clang-repl> auto toggle = [&state]() { return state; };
input_line_3:1:17: error: 'state' cannot be captured because it does not have automatic storage duration
1 | auto toggle = [&state]() { return state; };
| ^
input_line_1:1:5: note: 'state' declared here
1 | int state = 0;
| ^
error: Parsing failed.
Is this expected behavior on current mainline?