Skip to content

Commit 50d7645

Browse files
committed
[libc++][C++03] cherry-pick #104773
1 parent eaff28c commit 50d7645

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libcxx/include/__cxx03/__math/traits.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,19 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEX
109109

110110
// isnormal
111111

112-
template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
113-
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT {
114-
return __builtin_isnormal(__x);
115-
}
116-
117112
template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
118113
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT {
119114
return __x != 0;
120115
}
121116

117+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isnormal(float __x) _NOEXCEPT { return __builtin_isnormal(__x); }
118+
119+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isnormal(double __x) _NOEXCEPT { return __builtin_isnormal(__x); }
120+
121+
_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool isnormal(long double __x) _NOEXCEPT {
122+
return __builtin_isnormal(__x);
123+
}
124+
122125
// isgreater
123126

124127
template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>

libcxx/test/std/numerics/c.math/isnormal.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// We don't control the implementation on windows
1212
// UNSUPPORTED: windows
1313

14-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
15-
1614
#include <cassert>
1715
#include <cmath>
1816
#include <limits>

0 commit comments

Comments
 (0)