This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]