[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries
donald.chai at synopsys dot com
gcc-bugzilla@gcc.gnu.org
Thu Apr 21 18:10:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
--- Comment #5 from Donald Chai <donald.chai at synopsys dot com> ---
For what it's worth, post-increments behave as I would expect:
$ cat test.c
int main() {
int x = 1;
x++ ?: 0xbeef;
return x;
}
$ gcc-5 -x c test.c; ./a.out; echo $?
2
$ gcc-5 -x c++ test.c; ./a.out; echo $?
2
More information about the Gcc-bugs
mailing list