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

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 19:47:42 PDT 2017


EricWF added a comment.

I think the medium to long term goal should be to replace the `__ExceptionPtrFoo` functions we use with our own implementation, so we no longer rely on these MSVC implementation details.

However it appears that we don't have access to the internal headers that we might need, such as `ehdata.h`



================
Comment at: test/std/language.support/support.exception/propagation/current_exception.pass.cpp:10-11
 
-// exception_ptr has not been implemented on Windows
+// This test needs to be rewritten for the Windows exception_ptr semantics
+// which copy the exception each time the exception_ptr is copied.
 // XFAIL: LIBCXX-WINDOWS-FIXME
----------------
EricWF wrote:
> BillyONeal wrote:
> > We don't copy the exception each time the exception_ptr is copied -- exception_ptr models shared_ptr. See: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\crt\src\stl\excptptr.cpp"
> > 
> > We do make a copy when making the initial exception_ptr.
> Ah thanks for the clarification. So `std::current_exception()` always returns a different copy.
>  exception_ptr models shared_ptr. 

Oh fudge me, it not only models it but it actually uses MSVC's `shared_ptr` implementation. This seems so much sketchier now.


https://reviews.llvm.org/D32927





More information about the cfe-commits mailing list