From 7fff2dcc53e98592f681a060642547f04ed24977 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Tue, 5 Aug 2025 20:51:05 -0600 Subject: [PATCH] :bug: Fix small issues for clang-21 Problem: - There are a couple of build issues flagged by clang-21. Solution: - Fix them. --- include/stdx/bitset.hpp | 2 +- include/stdx/utility.hpp | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/stdx/bitset.hpp b/include/stdx/bitset.hpp index 8115f98..38bb12d 100644 --- a/include/stdx/bitset.hpp +++ b/include/stdx/bitset.hpp @@ -372,7 +372,7 @@ class bitset { [[nodiscard]] constexpr auto operator~() const -> bitset { bitset result{}; for (auto i = std::size_t{}; i < storage_size; ++i) { - result.storage[i] = ~storage[i]; + result.storage[i] = static_cast(~storage[i]); } return result; } diff --git a/include/stdx/utility.hpp b/include/stdx/utility.hpp index fab1bbf..d040bf7 100644 --- a/include/stdx/utility.hpp +++ b/include/stdx/utility.hpp @@ -255,19 +255,16 @@ template constexpr auto is_ct_v = is_ct_v; #ifndef CT_WRAP #define CT_WRAP(...) \ - [&](auto f) { \ + [&](auto f) constexpr { \ if constexpr (::stdx::is_ct_v) { \ return f(); \ - } else if constexpr (requires { \ - ::stdx::ct<[&]() constexpr { \ - return __VA_ARGS__; \ - }()>; \ - }) { \ - return ::stdx::ct<[&]() constexpr { return __VA_ARGS__; }()>(); \ + } else if constexpr (requires { ::stdx::ct(); } or \ + std::is_empty_v) { \ + return ::stdx::ct(); \ } else { \ return f(); \ } \ - }([&] { return __VA_ARGS__; }) + }([&]() constexpr { return __VA_ARGS__; }) #endif #ifndef CX_DETECT