[libcxx-commits] [libcxx] Adds back special-case for booleans in std::variant gated by _LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT. (PR #73121)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 22 10:40:29 PST 2023


bgra8 wrote:

> I am a bit confused by this Godbolt -- it seems like that code wasn't accepted by Clang 16 either, so this is probably not related to this change. https://godbolt.org/z/xjYj1eccq

Sorry my bad here! The missing bit is that we need to pass `--stdlib=libc++` in the compilation command. Compiling the given code with the previous `libc++` works fine and fails with the `libc++` at 170810fca6ee0f0e9a5b60c83122127d68bcc7ec.

Not sure what `libc++` Godbolt uses but I did the check by compiling the repro with this patch installed and:
* compiles fine with `-D_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT`;
* breaks similarly with Godbolt without `-D_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT`.

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


More information about the libcxx-commits mailing list