From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 65C3B382DC53 for ; Fri, 1 Sep 2023 13:01:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65C3B382DC53 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-oi1-x231.google.com with SMTP id 5614622812f47-3a76d882052so1238196b6e.0 for ; Fri, 01 Sep 2023 06:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1693573295; x=1694178095; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uQX6iGalI8KJtiJ+ZE0Kv1q+1bfOJi75I3+gCg3kj/Y=; b=Nv3G2g8h0f1bgJR4AKxHR4EPh8eeKDFWQjV+K88y68txRoz0E9lCJbAhXsblHbDGO2 yBSWc47kpB9GMvt2r1pGfv1h43//iPvpknb2r2AHpddBkRzP4f86cvqeFrRr5fa9MRO/ 7MxrqBNfaimJdNOUPu97mV38xvChh9aPCVrfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693573295; x=1694178095; h=content-transfer-encoding:cc:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uQX6iGalI8KJtiJ+ZE0Kv1q+1bfOJi75I3+gCg3kj/Y=; b=EALkbCOyfPo2TpEuxGS5tBwCrAbi1NjJquPMGNi0nmVrVFlRIHDf3I9sNzpZo7+0By os2MJgU8ZdXjK1EP8IAPtWjFP0kLN837DmxQmRnY1asQKe01AyTZ6LLtAWjcWh2mTQiZ tUNTmDAEM0Dq5PUsK3eGkDf1QVrc45jWljsj6LOl8DkU0baNjh44xv1L6m/OW6IUb3EP hVtLN2bdRRcYy79JFbH5lFgFWYXaCq6yE1/MFnvKMpZiJ8dCJ2582krQD8PSY0FIZFlY QlmqkjDGyii1vz2J/BtXGDu1RaQo1dPt92Tf5WCoBiFFgdn4E+KePfj2RQ+fu2otRw3e xF1w== X-Gm-Message-State: AOJu0YwgHZOvXZsHHqwdowLC9wTQpABhjJ+19fcygIYrWrS7re7Hdavj 5Tum3CmmmrH1PD4+1hgMjuRZwxP4o9hnpyxUMIqWV2YWUI9wFsLD X-Google-Smtp-Source: AGHT+IG68nEvJFMtz2m47ozeOPUtWto3AKnX3xyakR2m9hiTmifp5T8xVK9sN7x2GwKPWkOWV/gCaGh08FcD6IoWhc8= X-Received: by 2002:a05:6358:5e17:b0:132:d32d:d929 with SMTP id q23-20020a0563585e1700b00132d32dd929mr2168679rwn.20.1693573295319; Fri, 01 Sep 2023 06:01:35 -0700 (PDT) MIME-Version: 1.0 From: Ken Matsui Date: Fri, 1 Sep 2023 06:00:00 -0700 Message-ID: Subject: [PING][PATCH v2 2/2] libstdc++: Use new built-in trait __is_signed To: Jonathan Wakely Cc: gcc-patches , "libstdc++" , Ken Matsui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.9 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ping for the use of __is_signed built-in. Sincerely, Ken Matsui On Wed, Jul 12, 2023 at 6:45=E2=80=AFPM Ken Matsui wr= ote: > > This patch lets libstdc++ use new built-in trait __is_signed. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_signed): Use __is_signed built-in t= rait. > (is_signed_v): Likewise. > > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/std/type_traits | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/= std/type_traits > index 0e7a9c9c7f3..23ab5a4b1e5 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -865,6 +865,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > : public __bool_constant<__is_abstract(_Tp)> > { }; > > + /// is_signed > +#if __has_builtin(__is_signed) > + template > + struct is_signed > + : public __bool_constant<__is_signed(_Tp)> > + { }; > +#else > /// @cond undocumented > template bool =3D is_arithmetic<_Tp>::value> > @@ -877,11 +884,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { }; > /// @endcond > > - /// is_signed > template > struct is_signed > : public __is_signed_helper<_Tp>::type > { }; > +#endif > > /// is_unsigned > template > @@ -3240,8 +3247,14 @@ template > template > inline constexpr bool is_final_v =3D __is_final(_Tp); > > +#if __has_builtin(__is_signed) > +template > + inline constexpr bool is_signed_v =3D __is_signed(_Tp); > +#else > template > inline constexpr bool is_signed_v =3D is_signed<_Tp>::value; > +#endif > + > template > inline constexpr bool is_unsigned_v =3D is_unsigned<_Tp>::value; > > -- > 2.41.0 >