Take this toy program:
int main()
{
int a = 1;
a = ++a ;
}
Compilation under gcc 9.3 (or even trunk) with -Wall -std=c++17
outputs:
<source>:4:5: warning: operation on 'a' may be undefined [-Wsequence-point]
4 | a = ++a ;
| ~~^~~~~
I'm aware that in the past this indeed was an issue, but a different answer to the same SO question points to the part of the C++17 standard that was fixed to indicate that in an assignment operations the rhs is sequenced before the actual assignment:
8.18. ... 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.
So is this warning indeed bogus or am I missing something?