[libcxx-commits] [libcxx] [libc++][NFC] Remove __constexpr_is{nan, finite} (PR #106205)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 27 03:44:19 PDT 2024


================
@@ -554,20 +554,6 @@ using ::scalbnl _LIBCPP_USING_IF_EXISTS;
 using ::tgammal _LIBCPP_USING_IF_EXISTS;
 using ::truncl _LIBCPP_USING_IF_EXISTS;
 
-template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT {
-#if __has_builtin(__builtin_isnan)
-  return __builtin_isnan(__lcpp_x);
-#else
-  return isnan(__lcpp_x);
-#endif
-}
-
-template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT {
-  return std::isnan(__lcpp_x);
-}
-
 template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT {
----------------
frederick-vs-ja wrote:

Actually, most uses of `__constexpr_isinf` can also be replaced with `std::isinf` except for the ones in `std::norm`. I guess we can move `__constexpr_isinf` to `<complex>`.
https://github.com/llvm/llvm-project/blob/7c188abb4fe28d9784b12125e6924df2ce7de078/libcxx/include/complex#L965-L972

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


More information about the libcxx-commits mailing list