Full name of submitter (unless configured in github; will be published with the issue): Jakub Jelínek
Reference (section label): [basic.scope.block]/2
Link to reflector thread (if any):
Issue description: Is
void foo () {
auto f = [i = 5] () { int i; return 0; };
}
supposed to be valid after the P2579R0 changes? Before that paper and before P2036R3 this wouldn't be valid, because
the capture inhabited the same scope as int i; P2036R3 changed it to inhabit the parameter scope, so parent scope of it
and then [basic.scope.block]/2 triggered there. But P2579R0 says that the init capture inhabits lambda scope and isn't that the parent scope of the parameter scope, i.e. grandparent scope of the lambda's compound statement's scope?
And for auto f = [i = 5] <int N> () { int i; return 0; }; it is even grand-grandparent scope.
Suggested resolution:
Full name of submitter (unless configured in github; will be published with the issue): Jakub Jelínek
Reference (section label): [basic.scope.block]/2
Link to reflector thread (if any):
Issue description: Is
supposed to be valid after the P2579R0 changes? Before that paper and before P2036R3 this wouldn't be valid, because
the capture inhabited the same scope as int i; P2036R3 changed it to inhabit the parameter scope, so parent scope of it
and then [basic.scope.block]/2 triggered there. But P2579R0 says that the init capture inhabits lambda scope and isn't that the parent scope of the parameter scope, i.e. grandparent scope of the lambda's compound statement's scope?
And for
auto f = [i = 5] <int N> () { int i; return 0; };it is even grand-grandparent scope.Suggested resolution: