This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13322] operator associativity bug
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Dec 2003 20:50:51 -0000
- Subject: [Bug c++/13322] operator associativity bug
- References: <20031205204053.13322.supolj@cs.felk.cvut.cz>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-12-05 20:50 -------
Not a bug, the problem is that the order of execution is not defined by the C++ or C standard.
So when you do this:
stack(1) = stack[0] + stack[1]; //but stack(1) = 3 is ok
In gcc stack(1) is executed first which cause the variable stack to change becuase you modify stack
in that operator.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Component|debug |c++
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13322