[cxx-abi-dev] comlete objet 'structors for abstarct classes (was deleting destructors)
Mark Mitchell
mark at codesourcery.com
Mon Sep 30 08:33:58 UTC 2002
--On Monday, September 30, 2002 09:00:23 AM +0100 scott douglass
<sdouglass at arm.com> wrote:
> Hello,
>
> I've noticed that it's probably reasonable to not produce C1/D1/D0
> 'structors for abstract classes -- the language rules prevent ever
> needing to construct or destruct a complete object of abstract type.
You certinaly need D0:
struct S { virtual void f () = 0; ~S (); };
void g (S* sp) {
delete sp;
}
You may need D1 and C1 too; this is the flip side of your question
about whether you need D2/C2 when there are no virtual bases. The
ABI doesn't clearly say which version(s) of these functions derived
classes can call, so you can't eliminate any of them. You can,
however, assign both symbols to one address, which means the only
penalty you pay is a few bytes in object files.
--
Mark Mitchell mark at codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the cxx-abi-dev
mailing list