cplusplus / cplusplus/draft

[expr.prim.lambda.closure] Ambiguous parsing of implementation freedom

Open
#7,570 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3-Other
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

The second sentence in paragraph 3 reads:

An implementation may define the closure type differently from what is described below provided this does not alter the observable behavior of the program other than by changing:

  • the size and/or alignment of the closure type,
  • whether the closure type is trivially copyable ([class.prop]), or
  • whether the closure type is a standard-layout class ([class.prop]).

I think the intent of this sentence is: "the implementation isn't allowed to alter any observable behavior other than by changing these things" (i.e. the implementation can't change anything other than the size, alignment, etc.) But it really strongly reads to me that "the implementation may define the closer type differently [...] other than by changing" (i.e. the implementation can change anything except for the size, alignment, etc.) Which is the exact opposite of what I think the intended meaning is.

If we worded it this way instead, I think it would be impossible to misread:

An implementation may define the closure type differently from what is described below provided this does not alter the observable behavior of the program, except that an implementation may alter:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with paragraph 3 of [expr.prim.lambda.closure] in the C++ draft and compare the current sentence with the wording proposed in this issue. Done means the sentence unambiguously permits changes only to the listed closure-type properties while preserving other observable behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.