This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27145] addition using lambda expression gives wrong results
- 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: 13 Apr 2006 16:48:06 -0000
- Subject: [Bug c++/27145] addition using lambda expression gives wrong results
- References: <bug-27145-12527@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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