From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2a.google.com (mail-vk1-xa2a.google.com [IPv6:2607:f8b0:4864:20::a2a]) by sourceware.org (Postfix) with ESMTPS id 401C13858CDB for ; Sat, 13 May 2023 03:22:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 401C13858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.washington.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.washington.edu Received: by mail-vk1-xa2a.google.com with SMTP id 71dfb90a1353d-44ff6a049a7so3764354e0c.2 for ; Fri, 12 May 2023 20:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1683948163; x=1686540163; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iMS1RxnwvQf2XvaCkM5C6iTTsgH6e4KPA1jUBlJwOv8=; b=R0w/Uea5tOSK9LvB8QTNsKKh7x6OeY3ReghyA3BOTRHjdrR4LJjGMZh5PhHNP3BGrv QJHo3dYOjASt9k0CL8F5pmCtDOJPIVAllDAOGhY1pj7n63jd1EgoAyR5/oAJgjTVxWAT 0A1F6UR2KnyYORGR3ueengIQ4cnkn+lmN1/o8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683948163; x=1686540163; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iMS1RxnwvQf2XvaCkM5C6iTTsgH6e4KPA1jUBlJwOv8=; b=A+VorSgbHRIaAlNWjeCI85zvzr0/Ydw94LwDOBpy1rhUokkeinPXXmngogpM6I471T Haag4sYPGjmBtXg/S2As0majZ7OmSZcTsle3ooqdt9nlcp6sk2SrUgqpCyOUHUvLJKzr 4I8XuEb6H22+V06+q2qqDmebaIbh13UmvV34Lnd4DJ7nVZVoDPv3EnfDMyMwE0/PS6MW TQb8tWNCUwhXFMUuHVJYFR9Md8Vi7gW21j+U+tUmzeYLIqI+3tPir+UiqukSa7I0veAb tJYJgPV+CPHqiFp/Qlm2evwGp9OSlAWbRhX1Ne8HrBbDyj5y39QDHvxTzAKdzrZ86ryT VvYg== X-Gm-Message-State: AC+VfDxdckHJyQZx/wGKpZmzFpk/kJFpyKaskgFe1BlzItpcWEv5xl6h BPMNUEoHfR0JE8Kou8NB4EZNTAGOTeomJCTa0Oxk4w== X-Google-Smtp-Source: ACHHUZ4pD8n0LtwvddtKl9d4vihAtD8FBLIlOD3E9Di+Irx+APMls6hsFMXNrUOJoq59PofT0bfAelbxelOHK/i3amk= X-Received: by 2002:a1f:6081:0:b0:44f:fc8e:9837 with SMTP id u123-20020a1f6081000000b0044ffc8e9837mr9216290vkb.14.1683948163579; Fri, 12 May 2023 20:22:43 -0700 (PDT) MIME-Version: 1.0 References: <20230323110608.42262-1-kmatsui@cs.washington.edu> In-Reply-To: From: Ken Matsui Date: Fri, 12 May 2023 20:22:32 -0700 Message-ID: Subject: Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant To: Jonathan Wakely Cc: gcc-patches , "libstdc++" , Jonathan Wakely , Ville Voutilainen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: It appears that GCC 13 has been released, but I am wondering if there are any issues preventing this patch from being merged yet. Can you provide any information on this? On Sat, Apr 8, 2023 at 2:08=E2=80=AFPM Ken Matsui wrote: > > I see. Thank you! > > On Sat, Apr 8, 2023 at 12:52=E2=80=AFAM Jonathan Wakely wrote: > > > > This looks good, thanks, but we're too close to the gcc 13 release now,= and this isn't fixing any bugs. I'll push it after the release. > > > > > > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, wrote: > >> > >> In the type_traits header, both integral_constant and __bool_con= stant > >> 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 > >> --- > >> 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/inclu= de/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 ar= ray"); > >> @@ -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 ar= ray"); > >> @@ -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 ar= ray"); > >> @@ -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 ar= ray"); > >> @@ -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 ar= ray"); > >> @@ -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 >=3D 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 ar= ray"); > >> @@ -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) > >> -- > >> 2.40.0 > >>