From: Jonathan Wakely Date: Wed, 8 Aug 2018 15:41:05 +0000 (+0100) Subject: Add noexcept to std::integral_constant members X-Git-Tag: releases/gcc-6.5.0~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce46b1fe2800fb4fc7f8e6ac9b2e51880930c991;p=thirdparty%2Fgcc.git Add noexcept to std::integral_constant members Backport from mainline 2017-12-01 Jonathan Wakely * include/std/type_traits (integral_constant): Make member functions noexcept (LWG 2346). * include/std/utility (integer_sequence): Likewise. From-SVN: r263424 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4db1d7afa197..7c217e0c037c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2018-08-08 Jonathan Wakely + Backport from mainline + 2017-12-01 Jonathan Wakely + + * include/std/type_traits (integral_constant): Make member functions + noexcept (LWG 2346). + * include/std/utility (integer_sequence): Likewise. + Backport from mainline 2018-06-18 Jonathan Wakely diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 15deb90b2ef1..21bef15ed4af 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -71,12 +71,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static constexpr _Tp value = __v; typedef _Tp value_type; typedef integral_constant<_Tp, __v> type; - constexpr operator value_type() const { return value; } + constexpr operator value_type() const noexcept { return value; } #if __cplusplus > 201103L #define __cpp_lib_integral_constant_callable 201304 - constexpr value_type operator()() const { return value; } + constexpr value_type operator()() const noexcept { return value; } #endif }; diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility index 480bd5d18eaf..e72a10407a7a 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -296,7 +296,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct integer_sequence { typedef _Tp value_type; - static constexpr size_t size() { return sizeof...(_Idx); } + static constexpr size_t size() noexcept { return sizeof...(_Idx); } }; template