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


3211. Explicitly captured variable is not odr-usable in lambda contract

Section: 6.3  [basic.def.odr]     Status: open     Submitter: Abhinav Agarwal     Date: 2026-06-20

(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: