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++/35686] Incorrect value returned by function that uses a std::vector



------- 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


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