🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1768

When do thrown objects get destroyed?

#1768
From: scott douglass
Date: Sat, 19 Aug 1995 06:46
25 lines
1498 bytes
[I hope I'm not bringing up something that's been discussed recently.  I
tried to post this once before and it never showed up.  Perhaps it was
accidentally moderated into oblivion.]

I just re-read clause 15 of the draft working paper (and searched the
rest) and the only near-mention of when thrown objects (exceptions) get
destroyed was in 15.1:  "The temporary persists as long as there is a
handler being executed for that exception."

I think this implies the exception object will be destroyed when a handler
for it finishes without rethrowing the exception.  I would also expect
undefined behavior if the destructor for the exception tried to rethrow
the exception (i.e. 'throw;').

The compilers I've tested seem to never destroy the exception object for a
handled exception.

Would you agree that these compilers are wrong?

Thanks for your time,
--scott
---
[ 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: <sdouglass-1808952258430001@193.131.176.202>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 19 Aug 95 06:46:42 GMT
Approved: fjh@cs.mu.oz.au
Return-Path: <daemon@ncar.UCAR.EDU>
From: sdouglass@armltd.co.uk (scott douglass)
Newsgroups: comp.std.c++
Subject: When do thrown objects get destroyed?
X-Original-Date: Fri, 18 Aug 1995 22:58:43 +0100
Organization: Apple Computer, Inc.
Message-ID: <sdouglass-1808952258430001@193.131.176.202>