[libcxx-commits] [libcxx] [libc++] Fix missing 'get_new_handler()' for Windows builds (PR #150182)

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 13 12:14:34 PST 2026


petrhosek wrote:

> If my understand that we're actually already relying on some symbols from the MSVC STL is true, then I think it'd make a lot more sense to simply declare the functions in our headers and let the MSVC STL always handle the storage of the new handler.

There are only two APIs we depend on MSVC STL for: `std::get_new_handler`/`std::set_new_handler` and `std::exception_ptr`. If we provide our own implementation, we could drop the dependency on MSVC STL altogether which I believe would address your concern and is desirable for many libc++ users on Windows from what we heard.

This change implements `std::get_new_handler`/`std::set_new_handler` and https://github.com/llvm/llvm-project/pull/94977 is the implementation of `std::exception_ptr` which was donated by Microsoft but that still needs to be integrated properly into libc++.

https://github.com/llvm/llvm-project/pull/150182


More information about the libcxx-commits mailing list