This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15505] pure virtual destructor not overloaded, but accepted
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2004 23:07:08 -0000
- Subject: [Bug c++/15505] pure virtual destructor not overloaded, but accepted
- References: <20040517222115.15505.b.perschbacher@att.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-05-17 23:07 -------
Since you don't explicitly declare the existence of a user-defined
destructor in the derived class, the compiler synthesizes it automatically
for you. Thus, the derived class does have a final implementation of the
pure virtual function. This explains why the compiler (correctly) accepts
your code.
The standard allows to declare pure destructors, but since base classes
have to be destroyed anyway, you have to define it in addition. The lack
of a definition explains why the linker (correctly) complains about a
function definition.
Thus, your code is invalid and gcc is right, sorry.
Wolfgang
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15505