[PATCH] [libcxx] unexpected/terminate support for MS CRT

Marshall Clow mclow.lists at gmail.com
Tue Feb 17 08:34:14 PST 2015


This looks OK to me.
Ugly, but OK.[[ URL | name ]]


================
Comment at: test/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp:32
@@ -28,3 +31,3 @@
     // verify there is a previous unexpected handler
     assert(old);
     std::set_unexpected(f1);
----------------
K-ballo wrote:
> This assertion does not hold for MSVCRT, as a null handler represents the default behavior. Would it be better to make this check conditionally instead of marking the whole test as failed?
I believe that this check is incorrect.
Section D.8.3 says of `get_unexpected`:
//Returns//: The current unexpected_handler. [ //Note//: This may be a null pointer value. — //end note //]

================
Comment at: test/depr/exception.unexpected/set.unexpected/get_unexpected.pass.cpp:40
@@ -36,3 +39,3 @@
     std::set_terminate(f3);
     (*old)();
     assert(0);
----------------
K-ballo wrote:
> This does not hold for MSVCRT either. Assuming the previous assertion is skipped for it, this could be tested by setting the unexpected handler to its original value and calling `unexpected()`.
Yes, I think that's better.

http://reviews.llvm.org/D5131

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list