From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1888) id CFE433858D1E; Wed, 17 May 2023 15:52:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFE433858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684338739; bh=MLHZMEaRxeTHvgQ8qHC5KCenlalTbhafi/6aGFCopUg=; h=From:To:Subject:Date:From; b=uzQIBZgXihQ+K1gSdlEAdvNTMRORCM1i5lzvC3b0PdXSxVHU4hVBJX9VC9uLeGZ6E fCyVZ7HICkrHD0tc6OiP3PvQrx9FbLyI0+FzbRyFmGndf8cmoNq1Ak/h6jKu5fLrXj QYwucMx2rj6PqyEGsBGL/PymbdBY9EqVf85ql1ME= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Patrick Palka To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-940] libstdc++: use __bool_constant instead of integral_constant X-Act-Checkin: gcc X-Git-Author: Ken Matsui X-Git-Refname: refs/heads/master X-Git-Oldrev: e682d300261c0f2c8a5cc51151adabfe98e1006c X-Git-Newrev: 637edefc5863cf3b572c0c0bcd58fcc01ee60184 Message-Id: <20230517155219.CFE433858D1E@sourceware.org> Date: Wed, 17 May 2023 15:52:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:637edefc5863cf3b572c0c0bcd58fcc01ee60184 commit r14-940-g637edefc5863cf3b572c0c0bcd58fcc01ee60184 Author: Ken Matsui Date: Thu Mar 23 04:06:08 2023 -0700 libstdc++: use __bool_constant instead of integral_constant In the type_traits header, both integral_constant and __bool_constant are used. This patch unifies those usages into __bool_constant. libstdc++-v3/ChangeLog: * include/std/type_traits: Use __bool_constant instead of integral_constant. Signed-off-by: Ken Matsui Reviewed-by: Jonathan Wakely Reviewed-by: Patrick Palka Diff: --- libstdc++-v3/include/std/type_traits | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2bd607a8b8f..bc6982f9e64 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_enum template struct is_enum - : public integral_constant + : public __bool_constant<__is_enum(_Tp)> { }; /// is_union template struct is_union - : public integral_constant + : public __bool_constant<__is_union(_Tp)> { }; /// is_class template struct is_class - : public integral_constant + : public __bool_constant<__is_class(_Tp)> { }; /// is_function @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_trivial template struct is_trivial - : public integral_constant + : public __bool_constant<__is_trivial(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_trivially_copyable template struct is_trivially_copyable - : public integral_constant + : public __bool_constant<__is_trivially_copyable(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_standard_layout template struct is_standard_layout - : public integral_constant + : public __bool_constant<__is_standard_layout(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") is_pod - : public integral_constant + : public __bool_constant<__is_pod(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct _GLIBCXX17_DEPRECATED is_literal_type - : public integral_constant + : public __bool_constant<__is_literal_type(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_empty template struct is_empty - : public integral_constant + : public __bool_constant<__is_empty(_Tp)> { }; /// is_polymorphic template struct is_polymorphic - : public integral_constant + : public __bool_constant<__is_polymorphic(_Tp)> { }; #if __cplusplus >= 201402L @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// @since C++14 template struct is_final - : public integral_constant + : public __bool_constant<__is_final(_Tp)> { }; #endif /// is_abstract template struct is_abstract - : public integral_constant + : public __bool_constant<__is_abstract(_Tp)> { }; /// @cond undocumented @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __is_signed_helper<_Tp, true> - : public integral_constant + : public __bool_constant<_Tp(-1) < _Tp(0)> { }; /// @endcond @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// has_virtual_destructor template struct has_virtual_destructor - : public integral_constant + : public __bool_constant<__has_virtual_destructor(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct is_same #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME - : public integral_constant + : public __bool_constant<__is_same(_Tp, _Up)> #else : public false_type #endif @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_base_of template struct is_base_of - : public integral_constant + : public __bool_constant<__is_base_of(_Base, _Derived)> { }; #if __has_builtin(__is_convertible)