From: Jonathan Wakely Date: Fri, 1 Dec 2017 15:09:57 +0000 (+0000) Subject: Add noexcept to std::integral_constant members X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=352111c5b1519c9c56531e1fcd32380dcdd62305;p=gcc.git Add noexcept to std::integral_constant members * include/std/type_traits (integral_constant): Make member functions noexcept (LWG 2346). * include/std/utility (integer_sequence): Likewise. From-SVN: r255312 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e2545781298..a23830db4a5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2017-12-01 Jonathan Wakely + + * include/std/type_traits (integral_constant): Make member functions + noexcept (LWG 2346). + * include/std/utility (integer_sequence): Likewise. + 2017-11-30 Jonathan Wakely PR libstdc++/65927 diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 723c137f5b9..1d639e452f3 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 e7386320e2a..da17928feee 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -321,7 +321,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); } }; /// Alias template make_integer_sequence