[cxx-abi-dev] Details missing for EH 2.4.1 Overview of Throw Processing

Dennis Handly dhandly at cup.hp.com
Tue Dec 20 03:58:15 UTC 2011


>From: John McCall <rjmccall at apple.com>
>> Does the last sentence mean that if there is a catch for what the copy
>> constructor is throwing, it is ignored?

>I think this is just the ABI document being out-of-date vs. the standard.
>DR 475 jumped around a lot, but the final resolution (March 2010) makes
>it clear that we are *not* supposed to call std::terminate if an exception
>is thrown during the copy-initialization of an exception object.

So we just go to whatever catch is active or std::terminate?
But in any case, the copy constructor seems to be elided for both aC++ and
g++.

>We only terminate if an exception is thrown after the initialization is
>complete, e.g.  by a destructor of that full-expression,

So does this need to be mentioned for __cxa_end_catch or is it the generated
cleanup code for the throw?

Since copy constructor seems to be elided, there is no cleanup code for the
throw.  (Unless some complex conditions or lots of temps?  But these wouldn't
be the full-expression.)

g++ seems to not disallow that throw in __cxa_end_catch.
aC++ does too but does get lost if a catch is present.

>by the copy-initialization of a catch variable.
John.

Or under "2.5.1 Overview of Catch Processing" in the generated code?

g++ seems to handle this terminate call correctly.
aC++ calls terminate for the wrong reasons, both if there is and isn't a
catch.



More information about the cxx-abi-dev mailing list