This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Using EH from C revisited
- From: Stelios Xanthakis <sxanth at ceid dot upatras dot gr>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 10 May 2004 20:18:53 +0300 (EET DST)
- Subject: Using EH from C revisited
Hi.
With __attribute__((cleanup(function))) we have a small
problem emulating C++ behaviour with the constructors.
If a ctor throws the dtor must not be invoked.
This appears to work though:
struct A a __attribute__((cleanup(dtor_A_))) =
({ ctor_A_ (&a); a; });
The ctor_A_() call seems not to be in the cleanup region.
Is this ok? A bug a feature or undefined?
Another way to do it?
Thanks,
Stelios