[Bug libstdc++/41174] uncaught_exception always returns true

wwashby at earthlink dot net gcc-bugzilla@gcc.gnu.org
Thu Aug 27 14:27:00 GMT 2009



------- Comment #10 from wwashby at earthlink dot net  2009-08-27 14:27 -------
(In reply to comment #9)
> ...
> "when the exception handling mechanism, after completing evaluation of the
> expression to be thrown but before the exception is caught (15.1), calls a
> function that exits via an uncaught exception, 141"
> "141) For example, if the object being thrown is of a class with a copy
> constructor, std::terminate() will be called if that copy constructor exits
> with an exception during a throw."
> ...

I'm not sure that this applies in this situation.  An instance of BadE is
constructed because it is thrown, but BadE::BadE does not "[exit] via an
uncaught exception".  It both throws and catches an exception, and then returns
normally.  There is still an uncaught exception when BadE::BadE exits, but it
is the one that caused BadE to be constructed, not the one that BadE::BadE has
thrown (and caught).


-- 

wwashby at earthlink dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wwashby at earthlink dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41174



More information about the Gcc-bugs mailing list