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: Reporting a Bug in exception handling involving multiple inheritance and templates - GCC 2.95.2


> 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


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