From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,80e74153f40106ab X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-10 20:41:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.nuthinbutnews.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny02.gnilink.net.POSTED!53ab2750!not-for-mail From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Weird controlled behavior - Gnat 3.15p NT References: <5d6fdb61.0309040725.3403aa29@posting.google.com> <3F57B071.5030206@attbi.com> <1aujjb.m2u.ln@skymaster> In-Reply-To: <1aujjb.m2u.ln@skymaster> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 11 Sep 2003 03:40:56 GMT NNTP-Posting-Host: 162.84.176.54 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny02.gnilink.net 1063251656 162.84.176.54 (Wed, 10 Sep 2003 23:40:56 EDT) NNTP-Posting-Date: Wed, 10 Sep 2003 23:40:56 EDT Xref: archiver1.google.com comp.lang.ada:42369 Date: 2003-09-11T03:40:56+00:00 List-Id: Jean-Pierre Rosen wrote: > And what happens in C++ when an exception is raised by a destructor, > for this object and for objects not yet finalized? It is considerd very bad design in C++ to allow exceptions to escape from destructors, because of the poor semantic meaning of such a thing. (While you may fail to construct something and so have no object, when the compiler says it's time to destroy something, it's gone.) In any case, should an exception be thrown from a destructor, the code goes on to call destructors for the remaining completely constructed subobjects of the throwing object, if any, then for other objects whose lifetimes are ending due to the scope being exited because of the thrown exception. Should one of those destructors again throw, the special global function terminate() is called, and the program ends. I believe that in similar circumstances, Ada does all the finalizations and then raises Program_Error, so in both languages, Don't Do That (tm).