You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to [expr.ass], the following steps take place in order:
the value computation of rhs (i++ + 1)
the value computation of lhs (i)
the assignment to i
the value computation of the assignment expression
But it appears to me that [expr.ass] doesn't specify how the side effect of i++ (i.e. the modification to i) happens relative to step 3.
Also, P0145R3 mentions "the current proposal does not suggest any particular modification to the sequencing of unary expressions", which seems to suggest that i++ is still unsequenced relative to the assignment, thus the expression has UB under the post-P0145R3 rules just like under the old rules.
The text was updated successfully, but these errors were encountered:
Sorry, it seems that I misunderstood. [expr.ass] says "The right operand is sequenced before the left operand." which actually means the side effect of i++ is sequenced before step 2.
#1020, as a fix to #953, changed the example in [intro.execution]/10 so it now contains:
I suspect that this change is not correct.
According to [expr.ass], the following steps take place in order:
i++ + 1
)i
)i
But it appears to me that [expr.ass] doesn't specify how the side effect of
i++
(i.e. the modification toi
) happens relative to step 3.Also, P0145R3 mentions "the current proposal does not suggest any particular modification to the sequencing of unary expressions", which seems to suggest that
i++
is still unsequenced relative to the assignment, thus the expression has UB under the post-P0145R3 rules just like under the old rules.The text was updated successfully, but these errors were encountered: