This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25826] "pure virtual" destructors accepted by GCC, but cause link failure
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2006 19:27:46 -0000
- Subject: [Bug c++/25826] "pure virtual" destructors accepted by GCC, but cause link failure
- References: <bug-25826-6477@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-01-17 19:27 -------
You still need to declare A::~A().
That is what the following passage from that doc means:
Of course, any derived class' destructor must call the base class' destructor,
and so the destructor must still be defined (even if it's empty):
// file b.cpp
B::~B() { /* possibly empty */ }
If this definition were not supplied, you could still derive classes from B but
they could never be instantiated, which isn't particularly useful.
--
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=25826