[cfe-dev] (libc++) get_unexpected expected to return non-NULL

Aaron Ballman aaron at aaronballman.com
Thu Jul 16 04:55:33 PDT 2015


On Wed, Jul 15, 2015 at 11:56 PM, Andrew Parker
<andrew.j.c.parker at gmail.com> wrote:
> The test:
>
> \test\std\depr\exception.unexpected\set.unexpected\get_unexpected.pass.cpp
>
> expects the initial unexpected handler to be non-NULL:
>
> int main()
> {
>
>     std::unexpected_handler old = std::get_unexpected();
>     // verify there is a previous unexpected handler
>     assert(old);
>
> Is that really a requirement?

I believe so, yes. [unexpected.handler]p3 says: "The implementation’s
default unexpected_handler calls std::terminate()." which suggests
that there be an initial default unexpected_handler that is nonnull.

~Aaron

>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list