You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CWG3235 [stmt.expand] begin-expr and end-expr should refer to range #909
Issue description:
In paragraph 3, the exposition-only expressions begin-expr and end-expr are determined as specified in [stmt.ranged]. However, those definitions refer to the exposition-only variable range instead of the original for-range-initializer. The forms E.begin() and end(E) never exist in those definitions, range.begin() and end(range) are used instead.
Furthermore, the resolution of CWG3131 changes the definition of range for iterating expansion statements, begin-expr and end-expr should refer to this definition instead of the definition in [stmt.ranged].
Suggested resolution:
Explicitly refers to range in paragraph 3:
For an expression E, let the expressions begin-expr and end-expr be determined as specified in [stmt.ranged], where the exposition-only variable range is defined by the hypothetical declaration decltype(auto) range = (E); instead. An expression is expansion-iterable if it does not have array type and either
begin-expr and end-expr are of the form E.begin()range.begin() and E.end()range.end(), or
argument-dependent lookups for begin(E)begin(range) and for end(E)end(range) each find at least one viable candidate
changed the title [-][stmt.expand] begin-expr and end-expr should refer to range[/-][+]CWG3235 [stmt.expand] begin-expr and end-expr should refer to range[/+]on Oct 3, 2026
Activity
jensmaurer commentedon Oct 3, 2026
CWG3235
[-][stmt.expand] begin-expr and end-expr should refer to range[/-][+]CWG3235 [stmt.expand] begin-expr and end-expr should refer to range[/+]