[libcxx-commits] [libcxx] [libc++] std::byteswap support for _BitInt(N) (PR #196512)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sun May 10 06:37:28 PDT 2026


================
@@ -25,25 +25,37 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 template <integral _Tp>
 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
   if constexpr (sizeof(_Tp) == 1) {
+    // Identity for size-1 types. Handled before the __builtin_bswapg path
+    // because some Clang 22 builds have a constexpr-eval bug on the 1-bit
+    // (bool) case (fixed in commit f5410565137c, post-22.1.0).
----------------
philnik777 wrote:

When did this get fixed? I don't think we want to add a workaround here either if this is in a minor release. We can update the CI if needed.

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


More information about the libcxx-commits mailing list