This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [basic-improvements] try/finally support for c/c++
- From: Jason Merrill <jason at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>, gcc-patches at gcc dot gnu dot org,jakub at redhat dot com
- Date: Wed, 06 Nov 2002 09:03:45 -0500
- Subject: Re: [basic-improvements] try/finally support for c/c++
- References: <20021105231902.GA13127@redhat.com><20021105235718.GC20967@redhat.com>
On Tue, 5 Nov 2002 15:57:18 -0800, Richard Henderson <rth@redhat.com> wrote:
> You probably need to define __finally in terms of destructors
> in order for this to work out properly. E.g. a finally block
> is the destructor for an anonymous object of an anonymous type.
> Or something. Perhaps Jason or Mark could help here?
The code in the finally block is run on exit from the try block, except
that exiting a try block with a corresponding finally block via longjmp or
computed goto has undefined behavior.
Jason