Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[intro.execution] make function evaluation actually not interleave CWG2466 #2789

Closed
wants to merge 1 commit into from

Conversation

RedBeard0531
Copy link
Contributor

While the intent was clear and explicitly stated in the footnote, the prior wording didn't require B to be consistently sequenced before or after every A in F, only that they be individually pairwise sequenced.

While the intent was clear and explicitly stated in the footnote, the prior wording didn't require B to be consistently sequenced before or after every A in F, only that they be individually pairwise sequenced.
@zygoloid zygoloid added the cwg Issue must be reviewed by CWG. label Mar 15, 2019
@jensmaurer
Copy link
Member

jensmaurer commented Jun 14, 2019

Since sequenced-before is a transitive order, isn't your reformulation just creating the transitive hull, which is (specification-wise) a no-op?

Put differently, can you show an example execution with As and Bs that satisfy the current normative wording, but violates the footnote?

@zygoloid
Copy link
Member

Example:

int f() { A1(); A2(); return 0; };
int k = f() + B();

Prior to this change, what prevents A1 < B < A2 (where < is "sequenced before")?

Regardless, these words are subtle, and we shouldn't change them without CWG (and possibly SG1) consultation.

@languagelawyer
Copy link
Contributor

what prevents A1 < B < A2 (where < is "sequenced before")?

I have more crazy question: what prevents A2(); < A1(); or even return 0; < A1();?

@RedBeard0531
Copy link
Contributor Author

what prevents A2(); < A1(); or even return 0; < A1();?

http://eel.is/c++draft/intro.execution#9

Every value computation and side effect associated with a full-expression is sequenced before every value computation and side effect associated with the next full-expression to be evaluated.

@languagelawyer
Copy link
Contributor

Well, this doesn't say which full-expression is "next". But prolly I'm nagging to much. Continuing this way, we may start asking "where is it specified that the program is parsed from left to right and from top to bottom".

@jensmaurer jensmaurer changed the title [intro.execution] make function evaluation actually not interleave [intro.execution] make function evaluation actually not interleave CWG2466 Dec 18, 2020
@jensmaurer
Copy link
Member

Addressed by CWG2466.

@jensmaurer jensmaurer added the not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. label Feb 16, 2021
@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jun 15, 2021
@jensmaurer
Copy link
Member

Fixed by CWG2466 in commit da92321.

@jensmaurer jensmaurer closed this Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG. needs rebase The pull request needs a git rebase to resolve merge conflicts. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants