Skip to content

[range.access.begin] P2091R0's change to para 1 is ambiguous #3802

Closed
@CaseyCarter

Description

@CaseyCarter
Contributor

Per discussion starting at ericniebler/range-v3#1433 (comment).

P2091R0 adds the phrase "let t be an lvalue that denotes the same object as E if E is a glvalue and otherwise denotes the result of applying the temporary materialization conversion ([conv.rval]) to E." several times. This phrase is ambiguous. The intended reading is:

let t be an lvalue that denotes (the same object as E if E is a glvalue) or (the result of applying the TMC to E otherwise).

but it can also be read as:

let t be (an lvalue that denotes the same object as E if E is a glvalue) or (the result of applying the TMC to E otherwise).

which confusingly implies that t is an xvalue in the latter case. We could clarify the structure with bullets:

let t be an lvalue that denotes

  • the same object as E if E is a glvalue, or
  • the result of applying the TMC to E otherwise.

but the Standard really doesn't need more bullets, and this would add seven such bulleted lists in the introductory matter for seven existing bulleted lists. I'd rather not.

Suggestions?

Activity

jwakely

jwakely commented on Feb 27, 2020

@jwakely
Member

Maybe add a definition to the start of the parent subclause, [ranges.access], that says something like:

Within subclause [range.access], the reified object of a subexpression E denotes:

  • the same object as E if E is a glvalue, or
  • the result of applying the temporary materialization conversion ([conv.rval]) to E otherwise.

And then say "let t be the reified object for E."

self-assigned this
on Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @CaseyCarter@jwakely@jensmaurer

    Issue actions

      [range.access.begin] P2091R0's change to para 1 is ambiguous · Issue #3802 · cplusplus/draft