This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17507] Problems with shift and increment operator precedence
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2004 20:22:12 -0000
- Subject: [Bug c++/17507] Problems with shift and increment operator precedence
- References: <20040915184232.17507.work@paul.dubuc.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-09-15 20:22 -------
As for question 1) The standard says that the result is undefined, i.e.
the compiler can do whatever it pleases. That includes doing one of
the increments, four in the same order in which the appear left to
right, four in the reverse order, etc. It isn't a bug, but an opportunity
the standard leaves to the compiler writers to implement optimizations.
As for 2) the result is still undefined, and the fact that you get what
you expect can be attributed to luck.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17507