Using EH from C revisited

Stelios Xanthakis sxanth@ceid.upatras.gr
Mon May 10 17:18:00 GMT 2004


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




More information about the Gcc mailing list