This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Try constructors kills exception mechanism when base class constructors throws one
- To: casteyde dot christian at free dot fr
- Subject: Re: Try constructors kills exception mechanism when base class constructors throws one
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 7 Aug 1999 21:58:14 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <000001bee0fc$d5480580$b9301bd4@neptune>
> 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