Skip to content

Commit 59ec5eb

Browse files
authored
Merge pull request #257 from elbeno/gcc-15-fixes
🐛 Fix small issues for clang-21
2 parents 66cbe3e + 7fff2dc commit 59ec5eb

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

include/stdx/bitset.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class bitset {
372372
[[nodiscard]] constexpr auto operator~() const -> bitset {
373373
bitset result{};
374374
for (auto i = std::size_t{}; i < storage_size; ++i) {
375-
result.storage[i] = ~storage[i];
375+
result.storage[i] = static_cast<elem_t>(~storage[i]);
376376
}
377377
return result;
378378
}

include/stdx/utility.hpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,16 @@ template <typename T> constexpr auto is_ct_v<T const> = is_ct_v<T>;
255255

256256
#ifndef CT_WRAP
257257
#define CT_WRAP(...) \
258-
[&](auto f) { \
258+
[&](auto f) constexpr { \
259259
if constexpr (::stdx::is_ct_v<decltype(f())>) { \
260260
return f(); \
261-
} else if constexpr (requires { \
262-
::stdx::ct<[&]() constexpr { \
263-
return __VA_ARGS__; \
264-
}()>; \
265-
}) { \
266-
return ::stdx::ct<[&]() constexpr { return __VA_ARGS__; }()>(); \
261+
} else if constexpr (requires { ::stdx::ct<f()>(); } or \
262+
std::is_empty_v<decltype(f)>) { \
263+
return ::stdx::ct<f()>(); \
267264
} else { \
268265
return f(); \
269266
} \
270-
}([&] { return __VA_ARGS__; })
267+
}([&]() constexpr { return __VA_ARGS__; })
271268
#endif
272269

273270
#ifndef CX_DETECT

0 commit comments

Comments
 (0)