🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

When do thrown objects get destroyed?

#1760
From: scott douglass
Date: Mon, 21 Aug 1995 16:50
31 lines
1515 bytes
Distribution:
[I hope I'm not bringing up something that's been discussed recently.  I
tried to post this before and it never showed up.  Perhaps it was
accidentally routed 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

                 --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: <MATT.95Aug21095008@physics10.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: sdouglass@armltd.co.uk (scott douglass)
Newsgroups: comp.std.c++
Subject: When do thrown objects get destroyed?
Date: 21 Aug 1995 16:50:08 GMT
Organization: <none>
Approved: matt@physics10.Berkeley.EDU (Matt Austern)
Message-ID: <MATT.95Aug21095008@physics10.Berkeley.EDU>
NNTP-Posting-Host: physics10.berkeley.edu