[Bug c++/26669] lost temporary
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Mar 13 21:50:00 GMT 2006
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-03-13 21:50 -------
Not a bug, you are returning a reference to a local variables in:
friend
const
T& operator << (T t, const Arg& s) { return t <<= s; }
friend
const
T& operator >> (T t, const Arg& s) { return t >>= s; }
If you change the return type to T instead of T&, this works correctly, this is
hard to warn about since >>= returns a reference to t.
--
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=26669
More information about the Gcc-bugs
mailing list