aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-06-17 15:32:44 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-06-17 15:32:44 +0100
commit360a758ec81936f87978d6422677bb759202e47c (patch)
treece11effce5c10f1f4575fcc840fd604c853e4d32
parent26b1320ee5e2e9e107e092162d1c82b682504534 (diff)
downloadgcc-360a758ec81936f87978d6422677bb759202e47c.zip
gcc-360a758ec81936f87978d6422677bb759202e47c.tar.gz
gcc-360a758ec81936f87978d6422677bb759202e47c.tar.bz2
Add 'noexcept' to std::lerp
* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201). From-SVN: r272386
-rw-r--r--libstdc++-v3/ChangeLog2
-rw-r--r--libstdc++-v3/include/c_global/cmath8
2 files changed, 6 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f05970e..8311111 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,7 @@
2019-06-17 Jonathan Wakely <jwakely@redhat.com>
+ * include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).
+
PR libstdc++/90281 Fix string conversions for filesystem::path
* include/bits/fs_path.h (u8path) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]:
Use codecvt_utf8_utf16 instead of codecvt_utf8. Use
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index b843c18..01e56a5 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -1891,7 +1891,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Fp>
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