This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]