[libcxx-commits] [PATCH] D136868: [libc++][math.h] Remove unnecessary uses of __promote
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Oct 27 11:03:09 PDT 2022
philnik created this revision.
philnik added a reviewer: ldionne.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Removes __promote when it's just the identity.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D136868
Files:
libcxx/include/math.h
Index: libcxx/include/math.h
===================================================================
--- libcxx/include/math.h
+++ libcxx/include/math.h
@@ -333,7 +333,7 @@
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
signbit(_A1 __x) _NOEXCEPT
{
- return __libcpp_signbit((typename std::__promote<_A1>::type)__x);
+ return __libcpp_signbit(__x);
}
template <class _A1>
@@ -357,7 +357,7 @@
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
signbit(_A1 __x) _NOEXCEPT
{
- return ::signbit(static_cast<typename std::__promote<_A1>::type>(__x));
+ return ::signbit(__x);
}
template <class _A1>
@@ -400,7 +400,7 @@
typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
fpclassify(_A1 __x) _NOEXCEPT
{
- return __libcpp_fpclassify((typename std::__promote<_A1>::type)__x);
+ return __libcpp_fpclassify(__x);
}
template <class _A1>
@@ -416,7 +416,7 @@
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
fpclassify(_A1 __x) _NOEXCEPT
{
- return ::fpclassify(static_cast<typename std::__promote<_A1>::type>(__x));
+ return ::fpclassify(__x);
}
template <class _A1>
@@ -540,7 +540,7 @@
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnan(_A1 __x) _NOEXCEPT
{
- return __libcpp_isnan((typename std::__promote<_A1>::type)__x);
+ return __libcpp_isnan(__x);
}
template <class _A1>
@@ -588,7 +588,7 @@
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnormal(_A1 __x) _NOEXCEPT
{
- return __libcpp_isnormal((typename std::__promote<_A1>::type)__x);
+ return __libcpp_isnormal(__x);
}
template <class _A1>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136868.471231.patch
Type: text/x-patch
Size: 1695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221027/4ad0cbb9/attachment.bin>
More information about the libcxx-commits
mailing list