This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: virtual destructor unexpected pass


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]