This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30340] pure virtual function called on const & declared with previous declaration without a definition, const & assigned by temporary
- From: "fang at csl dot cornell dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jan 2007 16:42:14 -0000
- Subject: [Bug c++/30340] pure virtual function called on const & declared with previous declaration without a definition, const & assigned by temporary
- References: <bug-30340-13845@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from fang at csl dot cornell dot edu 2007-01-01 16:42 -------
You can confirm the lifetime of B() by printing something during its
destruction, and during the constructor of C. You'll be left with a dangling
reference to a temporary whose vptr has been invalidated, hence the error
message.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30340