Pure virtual destructor bug ?

Alexandre Oliva oliva@dcc.unicamp.br
Fri Apr 30 23:15:00 GMT 1999


On Apr  9, 1999, "Munagala V. S. Ramanath" <ram@netcom.com> wrote:

> Is there some reason pure virtual destructors are invalid?

Nope.  They're valid, but you *must* define one, even if you declare
it pure virtual.  By declaring a destructor pure-virtual, you're
essentially just marking its class as abstract.

> The standard says in section 12.4 [class.dtor] para 7 page 192:
> "A destructor can be declared virtual (10.3) or pure virtual (10.4) ..."

... "; if any objects of that class or any derived class are created
in the program, the destructor shall be defined."

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists




More information about the Gcc-bugs mailing list