This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 121a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2026-10-10


3235. begin-expr and end-expr should refer to range

Section: 8.7  [stmt.expand]     Status: tentatively ready     Submitter: Geng Cheng     Date: 2026-05-19

(From submission #909.)

The exposition-only expressions begin-expr and end-expr in 8.7 [stmt.expand] paragraph 3 refer to some hypothetical range variable when determined in 8.6.5 [stmt.ranged]. The forms E.begin and end(E) never exist there. Also, after issue 3131, the local definition of range is different.

Proposed resolution (approved by CWG 2026-10-06):

Change in 8.7 [stmt.expand] paragraph 3 as follows:

For an expression E, let the expressions begin-expr and end-expr be determined as specified in 8.6.5 [stmt.ranged], except that the exposition-only variable range is defined by the hypothetical declaration decltype(auto) range = (E);. An expression is expansion-iterable if it does not have array type and either