This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 120b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2026-07-26
(From submission #927.)
Consider:
void test() {
int i = 1;
auto f3 = [i] pre(i > 0) {}; // OK, i is captured explicitly.
}
The normative rules do not result in "OK".
Suggested resolution:
Change in 6.3 [basic.def.odr] bullet 10.2.4 as follows:
- ...
- the intervening scope is the lambda scope of a lambda-expression that has a simple-capture naming the entity or has a capture-default, and at least one of the following is also an intervening scope:
- the block scope of the lambda-expression
is also an intervening scope., or- a contract-assertion scope (6.4.10 [basic.scope.contract]) introduced by a function contract assertion (9.4.1 [dcl.contract.func]) of the function call operator or operator template of the corresponding closure type.