[libcxx-commits] [libcxx] [libc++][math] Implement constexpr {round, roundl}. (PR #226377)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 24 23:35:21 PDT 2026
https://github.com/zhangweize9-cyber created https://github.com/llvm/llvm-project/pull/226377
Changed `_LIBCPP_HIDE_FROM_ABI` to `_LIBCPP_CONSTEXPR_SINCE_CXX23` as required by P0533R9(#105174).
>From adfc2bbed99a05800e91137c842c0b5ff4c8adec Mon Sep 17 00:00:00 2001
From: zhangweize9-cyber <zhangweize9 at gmail.com>
Date: Fri, 25 Sep 2026 14:09:47 +0800
Subject: [PATCH] [libc++][math] Implement constexpr {round, roundl} Changed
`_LIBCPP_HIDE_FROM_ABI` to `_LIBCPP_CONSTEXPR_SINCE_CXX23` as required by
P0533R9.
---
libcxx/include/__math/rounding_functions.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcxx/include/__math/rounding_functions.h b/libcxx/include/__math/rounding_functions.h
index aadeb395fa2eb1..3146146d9907d8 100644
--- a/libcxx/include/__math/rounding_functions.h
+++ b/libcxx/include/__math/rounding_functions.h
@@ -204,14 +204,14 @@ template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
// round
-[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_round(__x); }
+[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX23 float round(float __x) _NOEXCEPT { return __builtin_round(__x); }
template <class = int>
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT {
return __builtin_round(__x);
}
-[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double round(long double __x) _NOEXCEPT {
+[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX23 long double round(long double __x) _NOEXCEPT {
return __builtin_roundl(__x);
}
More information about the libcxx-commits
mailing list