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

Inconsistency in [expr.ass] and [intro.execution] #953

Closed
akemimadoka opened this issue Oct 18, 2016 · 4 comments
Closed

Inconsistency in [expr.ass] and [intro.execution] #953

akemimadoka opened this issue Oct 18, 2016 · 4 comments
Assignees

Comments

@akemimadoka
Copy link
Contributor

akemimadoka commented Oct 18, 2016

[expr.ass]/1:

In all cases, the assignment is sequenced after the value
computation of the right and left operands, and before the value computation of the assignment expression.
The right operand is sequenced before the left operand

[intro.execution]/15:

i = v[i++]; // the behavior is undefined
i = 7, i++, i++; // i becomes 9
i = i++ + 1; // the behavior is undefined
i = i + 1; // the value of i is incremented

With the assignment being sequenced after the value
computation of the right and left operands, why is i = v[i++] and i = i++ + 1 undefined behavior?

@jensmaurer
Copy link
Member

It seems we've overlooked this example when we applied Gaby's order-of-initialization paper.

@Kingwl
Copy link

Kingwl commented Feb 1, 2018

it's very helpful to me!

@ly0
Copy link

ly0 commented Feb 1, 2018

it's very helpful to me!

btw, the issuer is soooooo lovely, cute, supercalifragilisticexpialidocious in real world.
So the issue should be supposed to be highly paid attention.

@AngryPowman
Copy link

it's very helpful to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants