This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: virtual destructor unexpected pass
- To: Todd Vierling <tv at pobox dot com>
- Subject: Re: virtual destructor unexpected pass
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 02 Sep 1998 00:21:00 -0300
- Cc: egcs-bugs at cygnus dot com
- References: <Pine.NEB.4.02.9809011945330.22231-100000@duhnet.net>
Todd Vierling <tv@pobox.com> writes:
> It causes a link error that ~A() is undefined; I believe that the
> destructor in A below is an error and there should be a compiler
> error instead.
Nope, it is valid to declare an pure virtual destructor, but it *must*
be defined anyway if you instantiate any subclass of the class. A
compile-time error would be wrong, because the destructor could be
defined in another translation unit.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil