[libcxx-commits] [libcxx] [libc++] constexpr is_sufficiently_aligned (PR #146787)
Damien L-G via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 3 10:06:43 PDT 2025
================
@@ -28,10 +27,11 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool is_sufficiently_aligned(_Tp* __ptr) {
# ifdef _LIBCPP_COMPILER_CLANG_BASED
return __builtin_is_aligned(__ptr, _Alignment);
# else
- if constexpr (is_constant_evaluated())
+ if consteval {
return __builtin_constant_p(__builtin_assume_aligned(__ptr, _Alignment) != nullptr);
----------------
dalg24 wrote:
The goal was to determine whether or not it is implementable, and potentially opening a LWG issue before C++26 is shipped.
https://github.com/llvm/llvm-project/pull/146787
More information about the libcxx-commits
mailing list