Article View: comp.std.c++
Article #2830Re: Exceptions and dtor
From: Sam Fenster
Date: Tue, 05 Dec 1995 08:40
Date: Tue, 05 Dec 1995 08:40
45 lines
2594 bytes
2594 bytes
The text from the DWP, as quoted by David Chase below, is actually completely unclear as to whether an exception thrown during processing of a prior exception causes program termination. > John Max Skaller <maxtal@suphys.physics.su.oz.au> () writes: >> For example you should be able to throw an exception INSIDE the body of a >> destructor and catch it, pre-empting the execution of the rest of the body, >> but then continuing unwinding for the first exception which triggered >> destruction in the first place. chase@centerline.com (David Chase) writes: > I would hope that this is the intent of the committee.[...] Looking at the > April draft, I believe that this is the intent of the committee, and that > the April draft supports it. See [except.terminate] > > "In the following situations, exception handling must be abandoned... > ... > -- when an attempt by the implementation to destroy an object during > stack unwinding [1] exits [2] using an exception" > > [1] Stack unwinding is defined to be the destruction of objects constructed > on the path from a try block to the throw-expression. > > [2] "exits" is the crucial word -- a destructor which throws an exception > but does not propagate it to the destructor's caller, is not using the > exception to exit. The part of this text that makes it incomprehensible is the undefined terminology, "when an *attempt* exits..." What is an "attempt"? Do they mean: - "when any *function* exits using an exception"? - "when *any* *block* of code is exited by means of a `throw' statement"? - "when the *destructor* of an object that was on the stack when the prior exception was thrown exits with an exception"? No, I don't want someone to tell me their personal interpretation. I want the committee to revise text of the draft to use unambiguous, *well-defined* terminology. --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<FENSTER.95Dec4181558@shadow.cs.columbia.edu>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!MattReferences:
<49nif7$ime@oznet03.ozemail.com.au> <49tuq4$238@wcap.centerline.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt From: fenster@cs.columbia.edu (Sam Fenster) Newsgroups: comp.std.c++ Subject: Re: Exceptions and dtor Date: 05 Dec 1995 08:40:16 GMT Organization: Columbia University Department of Computer Science Approved: Matt@Austern Message-ID: <FENSTER.95Dec4181558@shadow.cs.columbia.edu> References: <49nif7$ime@oznet03.ozemail.com.au> <49tuq4$238@wcap.centerline.com> NNTP-Posting-Host: austern.hip.berkeley.edu