From: Jonathan Wakely Date: Thu, 5 Mar 2020 16:52:19 +0000 (+0000) Subject: Add 'noexcept' to std::lerp X-Git-Tag: releases/gcc-9.3.0~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=494166791ea6b669f17cf3fbb037000396018420;p=thirdparty%2Fgcc.git Add 'noexcept' to std::lerp Backport from mainline 2019-06-17 Jonathan Wakely * include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201). --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d5eb49b5a82f..0b91af9bce42 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2020-03-05 Jonathan Wakely + Backport from mainline + 2019-06-17 Jonathan Wakely + + * include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201). + Backport from mainline 2019-11-07 Jonathan Wakely diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath index b843c18f1dac..01e56a559fe7 100644 --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -1891,7 +1891,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template constexpr _Fp - __lerp(_Fp __a, _Fp __b, _Fp __t) + __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept { if (__a <= 0 && __b >= 0 || __a >= 0 && __b <= 0) return __t * __b + (1 - __t) * __a; @@ -1908,15 +1908,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } constexpr float - lerp(float __a, float __b, float __t) + lerp(float __a, float __b, float __t) noexcept { return std::__lerp(__a, __b, __t); } constexpr double - lerp(double __a, double __b, double __t) + lerp(double __a, double __b, double __t) noexcept { return std::__lerp(__a, __b, __t); } constexpr long double - lerp(long double __a, long double __b, long double __t) + lerp(long double __a, long double __b, long double __t) noexcept { return std::__lerp(__a, __b, __t); } #endif // C++20