[Bug c++/27145] addition using lambda expression gives wrong results

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Apr 13 16:48:00 GMT 2006



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-04-13 16:48 -------
You forgot about operator precidence.
So "array[0] + boolval ? array[1] : 0;"
is the same as "(array[0] + boolval )? array[1] : 0;"
and not what you want:
array[0] + (boolval ? array[1] : 0);


-- 

pinskia at gcc dot gnu dot org changed:

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


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



More information about the Gcc-bugs mailing list