[libcxx-commits] [libcxx] [libc++] Re-introduce special support for narrowing conversions to bool in variant (PR #73121)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 22 12:06:36 PST 2023


================
@@ -81,6 +81,12 @@ Deprecations and Removals
 - The non-conforming constructor ``std::future_error(std::error_code)`` has been removed. Please use the
   ``std::future_error(std::future_errc)`` constructor provided in C++17 instead.
 
+- `P1957 <https://wg21.link/P1957>` has been implemented in Clang and libc++ removed a code path that led to
+  narrowing conversions in ``std::variant`` behaving in a non-standard way. This may change how some uses of
+  ``std::variant``'s constructor behave in user code. The ``_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT``
+  macro is provided to restore the previous behavior, and it will be supported in the LLVM 18 release only.
+  In LLVM 19 and beyond, ``_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT`` will not be honored anymore.
----------------
ldionne wrote:

Good point, done in a9c149df7666bb2f8755794b97573134e5cfeb38

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


More information about the libcxx-commits mailing list