[gcc(refs/users/mikael/heads/pr121185_v01)] libstdc++: Use __promote_3 for std::hypot [PR121097]
Mikael Morin
mikael@gcc.gnu.org
Thu Jul 24 10:48:15 GMT 2025
https://gcc.gnu.org/g:ca8f7552a61dd98f1cfb67db2cb6543c4bf7d84e
commit ca8f7552a61dd98f1cfb67db2cb6543c4bf7d84e
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Jul 15 21:29:33 2025 +0100
libstdc++: Use __promote_3 for std::hypot [PR121097]
The __promoted_t alias is only defined when __cpp_fold_expressions is
defined, which might not be the case for some hypothetical C++17
compilers.
Change the 3-arg std::hypot to just use __gnu_cxx::__promote_3 which is
always available.
libstdc++-v3/ChangeLog:
PR libstdc++/121097
* include/c_global/cmath (hypot): Use __promote_3 instead of
__promoted.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Diff:
---
libstdc++-v3/include/c_global/cmath | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index 27c21ca19eb6..65a3b8144f35 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -3792,10 +3792,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return std::__hypot3<long double>(__x, __y, __z); }
template<typename _Tp, typename _Up, typename _Vp>
- __gnu_cxx::__promoted_t<_Tp, _Up, _Vp>
+ typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
hypot(_Tp __x, _Up __y, _Vp __z)
{
- using __type = __gnu_cxx::__promoted_t<_Tp, _Up, _Vp>;
+ using __type = typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type;
return std::__hypot3<__type>(__x, __y, __z);
}
More information about the Libstdc++-cvs
mailing list