[Bug c++/30340] pure virtual function called on const & declared with previous declaration without a definition, const & assigned by temporary
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Jan 1 05:42:00 GMT 2007
------- Comment #4 from pinskia at gcc dot gnu dot org 2007-01-01 05:42 -------
For the last question on this code:
C c(1, B());
What is the life time of the temp that holds B()?
I say it is only for that expression and not for the lifetime of c so you are
now using a temp whos life time expired which means the behavior is undefined
and what GCC is producing at runtime is correct.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30340
More information about the Gcc-bugs
mailing list