[Bug c++/35686] Incorrect value returned by function that uses a std::vector
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Mar 24 21:36:00 GMT 2008
------- Comment #5 from pinskia at gcc dot gnu dot org 2008-03-24 21:35 -------
(In reply to comment #3)
> Does this mean that it is correct that no assigment takes place?
So what is happening is that next[0] returns a reference and that reference
goes invalid when next.push_back(-1) gets called. So the assignment happens,
just to the wrong place :).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35686
More information about the Gcc-bugs
mailing list