This is the mail archive of the gcc-bugs@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]

Re: Try constructors kills exception mechanism when base class constructors throws one


>     When a base class constructor throws an exception that is to be
> caught in the try-constructor of a derived class, the exception is
> caught and everything is OK.

Thanks for your bug report. The bug is slightly different: According
to standard C++, an exception in a constructor should be automatically
rethrown when the function-try-block leaves through a catch clause.

So, in your code, the exception should get out of the construction of
a, and std::terminate should be invoked as the exception is not
caught.

Regards,
Martin


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