Re:GCC starts move towards implementation in C++
by stingraycharles on Monday May 31, 2010 @04:05PM
(#1393351)
The constructor might be partially executed before the exception is thrown (for example, allocated memory or locked resources), in which case those things don't get cleaned up.
I'm not arguing it isn't correct behavior, it's just that things don't always seem as easy and straightforward as they look on first sight.
Of course it is not called -- the object has failed to construct. There is no object. You cannot call a destructor on nothing. Now if some data member has been constructed but the call constructor failed, destructors for such members will be called.