From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 504E63857726 for ; Wed, 12 Jul 2023 10:04:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 504E63857726 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689156296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OajZg+nCYlylLHmAdfgExn4VjJfeYvz3VRvSwJ5M3is=; b=GF2YaNnO4zjCCYTUvJ7W3V8XEg40sbpnFnGjCax8OOYuwtUqtuEn9yDohJ5CBV76FhOYmm 4sWdfYrDp8bg0X3f2q0C76jlLFzdMOnrbFHt8MUZABAP8JCcOxaFIJdmn8LnQ8q8lXNZH1 Gbwe5CT0QXxqsahmAdCvxYzYOOFgLu8= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-5DyUVizwN5ac4vU1Hxpujw-1; Wed, 12 Jul 2023 06:04:54 -0400 X-MC-Unique: 5DyUVizwN5ac4vU1Hxpujw-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b710c5677eso49826571fa.0 for ; Wed, 12 Jul 2023 03:04:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689156293; x=1691748293; h=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=OajZg+nCYlylLHmAdfgExn4VjJfeYvz3VRvSwJ5M3is=; b=ht2hP8lJKIu1rj4PKmjofleda2pQLC18/t0kb1RgoXdZ0btQa4Mh3X0uMWGcxiFieT 9rKJAKXrOVeGZmkFWZhmQNRLE0Z5WuIysiiuZLBJI8bbmFH9BXZNpInvDvNeIVZsAW1I BVQU+2WjDnagiZTnMJNhvnhlquCrBKDx2NGIYzHC8bVc191VPTs0TO+LBFfpk56Ilpcd j7e6BOa0R6UU/jmMYwbRekyvWHOQjWQaMgmqgHakA/6kcIQLHEfQPWnFyaBsGcmoLc68 bivjimcTv1BEXWoZjfbZrJ15LUwEnXyWIBAPLXIB4Wykm8VpEe3nuVR/mgM4f2n9C+ax WjhQ== X-Gm-Message-State: ABy/qLYWyufow9iVkIOGY+qffdYygwYVnXnnjg65A7xINGRiWtns7KDn 7KMVaiuTdOCd90MFrj8zzFWlchko9ApTVBDG4ZSQv/HqBiyrqq1lo1lJfxXMiWHY4rTnFXTzE1p zLG3/CrbTPd98RF81wwzt7fOFsEmNWi0= X-Received: by 2002:a2e:9208:0:b0:2b6:f009:921a with SMTP id k8-20020a2e9208000000b002b6f009921amr14290774ljg.13.1689156292975; Wed, 12 Jul 2023 03:04:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlEtu4Hwzx+nBawzsiY38ASU15awD1UuJ2PQ3LpuN6vQflli+8vUCgHJqjVPUmfMR59ZVRIApsWkEadEWUmOr0Y= X-Received: by 2002:a2e:9208:0:b0:2b6:f009:921a with SMTP id k8-20020a2e9208000000b002b6f009921amr14290762ljg.13.1689156292713; Wed, 12 Jul 2023 03:04:52 -0700 (PDT) MIME-Version: 1.0 References: <20230708055435.68714-1-kmatsui@gcc.gnu.org> <20230708111308.92402-1-kmatsui@gcc.gnu.org> <20230708111308.92402-2-kmatsui@gcc.gnu.org> In-Reply-To: <20230708111308.92402-2-kmatsui@gcc.gnu.org> From: Jonathan Wakely Date: Wed, 12 Jul 2023 11:04:41 +0100 Message-ID: Subject: Re: [PATCH v4 2/2] libstdc++: use new built-in trait __is_unsigned To: Ken Matsui Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: On Sat, 8 Jul 2023 at 12:14, Ken Matsui via Libstdc++ wrote: > > This patch lets libstdc++ use new built-in trait __is_unsigned. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_unsigned): Use __is_unsigned built-in > trait. > (is_unsigned_v): Likewise. > > Signed-off-by: Ken Matsui OK for trunk after the front-end implementation of __is_unsigned is committed. > --- > libstdc++-v3/include/std/type_traits | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index 0e7a9c9c7f3..7eeb0da7a27 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -884,10 +884,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { }; > > /// is_unsigned > +#if __has_builtin(__is_unsigned) > + template > + struct is_unsigned > + : public __bool_constant<__is_unsigned(_Tp)> > + { }; > +#else > template > struct is_unsigned > : public __and_, __not_>>::type > { }; > +#endif > > /// @cond undocumented > template > @@ -3242,8 +3249,14 @@ template > > template > inline constexpr bool is_signed_v = is_signed<_Tp>::value; > + > +#if __has_builtin(__is_unsigned) > +template > + inline constexpr bool is_unsigned_v = __is_unsigned(_Tp); > +#else > template > inline constexpr bool is_unsigned_v = is_unsigned<_Tp>::value; > +#endif > > template > inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...); > -- > 2.41.0 >