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++/27344] associativity of * operator incorrect when compiled without optimization



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-04-28 00:00 -------
(five * 2 * five.neg());

This is equivlant to:
(five * 2) * (five.neg())
but the C and C++ standard do not specify which expression is evulated first.
In that (five * 2) might be evulated first or five.neg().  five.neg() has a
side effect of changing five (_value *= -1;) which makes the above statement
undefined as five is accessed and written to without a sequence point
inbetween.


And it makes it a duplicate of PR 11751.

*** This bug has been marked as a duplicate of 11751 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27344


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