Full name of submitter: Geng Cheng
Reference: [stmt.expand]
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
Full name of submitter: Geng Cheng
Reference: [stmt.expand]
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()andend(E)never exist in those definitions,range.begin()andend(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 declarationdecltype(auto) range = (E);instead. An expression is expansion-iterable if it does not have array type and eitherE.begin()range.begin()andE.end()range.end(), orbegin(E)begin(range)and forend(E)end(range)each find at least one viable candidate