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++/13322] operator associativity bug


------- 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


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