[PATCH] D32927: [libc++] Implement exception_ptr on Windows

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 16:53:22 PDT 2017


EricWF created this revision.
Herald added a subscriber: mgorny.

This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC. The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems.

Note there are still 2 outstanding exception_ptr/nested_exception test failures.

- `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time.
- `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion.

This patch also gets most of the `<future>` tests passing as well.


https://reviews.llvm.org/D32927

Files:
  include/exception
  lib/CMakeLists.txt
  src/exception.cpp
  src/support/runtime/exception_pointer_msvc.ipp
  test/std/language.support/support.exception/except.nested/assign.pass.cpp
  test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
  test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
  test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
  test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
  test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
  test/std/language.support/support.exception/propagation/current_exception.pass.cpp
  test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
  test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
  test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32927.98039.patch
Type: text/x-patch
Size: 14482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170505/45b94ad5/attachment.bin>


More information about the cfe-commits mailing list