Topic: Format of compiler generated derived destructor when base has


Author: AlbertoBarbati@libero.it (Alberto Barbati)
Date: Mon, 11 Apr 2005 23:22:22 GMT
Raw View
qazmlp wrote:
> Could anybody reply to this post? I would like to know what exactly
>>>
>>>Will it be this:
>>> - ~derived(); or
>>> - virtual ~derived(); or
>>> - virtual ~derived() throw();
>

It's "virtual ~derived() throw();" The relevant paragraphs are:

10.3/4 "Even though destructors are not inherited, a destructor in a
derived class overrides a base class destructor declared virtual; [...]"

(also notice footnote 97: "The use of the virtual specifier in the
declaration of an overriding function is legal but redundant (has empty
semantics).")

15.4/13 "An implicitly declared special member function (clause 12)
shall have an exception-specification. If f is an implicitly declared
[...] destructor, [...] f shall allow no exceptions if every function it
directly invokes allows no exceptions."

Alberto

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]