This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Reporting a Bug in exception handling involving multiple inheritance and templates - GCC 2.95.2
- To: hunter at cabm dot rutgers dot edu
- Subject: Re: Reporting a Bug in exception handling involving multiple inheritance and templates - GCC 2.95.2
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 11 Dec 1999 00:27:27 +0100
- CC: gcc-bugs at gcc dot gnu dot org
- References: <385169D6.CB90198F@cabm.rutgers.edu>
> The following program produces an Abort core dump between printing
> "Test3" and "Test4".
Thanks for your bug report. This is not a bug in g++, but in your
program. To see this, put the lines
AAExcept<std::logic_error> x("junk");
std::exception &e = x;
into your program; gcc will then say
type `exception' is ambiguous base class for type `AAExcept<logic_error,AAException>'
Because you inherit std::exception in two bases, conversion is
ambiguous, and fails at runtime. That's why the exception is not
caught. So the program calls std::terminate, which calls abort.
Regards,
Martin