This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35686] Incorrect value returned by function that uses a std::vector
- 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: 24 Mar 2008 21:16:25 -0000
- Subject: [Bug c++/35686] Incorrect value returned by function that uses a std::vector
- References: <bug-35686-15968@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-03-24 21:16 -------
> next[0] = addNode();
This will invoke undefined behavior as the order of execution of the lhs and
rhs of the assignment expression is unspecified. So a compiler can invoke
either next[0] first or addNode() first. Both are valid.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
GCC build triplet| ../configure --enable- |../configure --enable-
|threads=posix --prefix=/usr |threads=posix --prefix=/usr
|--with-local- |--with-local-
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35686