This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries
- From: "donald.chai at synopsys dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Apr 2016 18:09:59 +0000
- Subject: [Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries
- Auto-submitted: auto-generated
- References: <bug-70744-4 at http dot gcc dot gnu dot org/bugzilla/>
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