From 7334231810061736875
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,db4807a3f0a1e742
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-07-26 23:23:11 PST
Newsgroups: comp.std.c++
Path: nntp.gmd.de!Germany.EU.net!EU.net!uunet!news.cygnus.com!news!jason
From: jason@cygnus.com (Jason Merrill)
Subject: Re: Multiple inheritance and delete
In-Reply-To: immel@chord.centerline.com's message of 26 Jul 1994 11:19:46 GMT
Content-Type: text/plain; charset=US-ASCII
Message-ID: <JASON.94Jul26224158@deneb.cygnus.com>
Sender: news@cygnus.com
Nntp-Posting-Host: deneb.cygnus.com
Organization: Cygnus Support, Mountain View, CA
References: <IMMEL.94Jul15110950@chord.centerline.com>
	<IMMEL.94Jul18092230@chord.centerline.com>
	<30f0io$cad@f111.iassf.easams.com.au>
	<JASON.94Jul24193114@deneb.cygnus.com>
	<311bhg$t4p@f111.iassf.easams.com.au>
	<IMMEL.94Jul26071948@chord.centerline.com>
Mime-Version: 1.0
Date: Wed, 27 Jul 1994 05:41:58 GMT
Lines: 33

>>>>> Mark Immel <immel@chord.centerline.com> writes:

> We could read the statement about destructors, then, to imply that the
> destructor is declared and defined if the base classes have destructors,
> etc.., or infer that it should have said declared where it said
> generated

I prefer this interpretation.

> or (and this is the solution I would favor), parallel the
> constructor language exactly:

>   "If no destructor has been declared for class X, a default destructor
>    is implicitly declared."

> Of course, if none of the base classes, member need destructors the compiler
> can optimize away any calls (explicit or implicit) to the function.  But,
> if I can say ~int, I sure want to be able to say ~X for X any class!

You can.  12.6 says "Using the [explicit destructor call] notation for a
type that does not have a destructor has no effect."

The reason we have to have copy constructors implicitly declared for all
classes so so that overload resolution will work.  Destructors cannot be
overloaded, so this is not a concern.

I'd prefer to leave it as "this class has a destructor" or "this class does
not have a destructor" rather than "this class has a complex destructor" or
"this class has a trivial compiler-generated destructor" like we have to
deal with for constructors (a complex constructor is either one that is
user-defined or one that calls other complex constructors).

Jason


