[Bug c++/119466] Incorrect order of evaluation for assignment expression

2025-03-25 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119466 --- Comment #3 from Jakub Jelinek --- And I guess it is solely if the RHS is a CALL_EXPR, if I change the testcase to int foo (int &x, int *&y) { y = &x; x++; return x; } int main () { int a = 4; int b = 9; int *c = &b; *c = foo (

[Bug c++/119466] Incorrect order of evaluation for assignment expression

2025-03-25 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119466 --- Comment #2 from Jakub Jelinek --- I think w normally honor the C++17 rules, it can be seen on int foo (int &x, int *&y) { y = &x; x++; return x; } int & bar (int *p) { return *p; } int main () { int a = 4; int b = 9; int *c =