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.129.124]) by sourceware.org (Postfix) with ESMTPS id 014313857735 for ; Wed, 12 Jul 2023 10:04:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 014313857735 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=1689156295; 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=CKtfBDOKowZY3hXMEqF0cs+c9kccPBbIlRlEa4eeNR5SVBYRZM6suxQfFHe37PrTwRLtV1 ylgwKnKKpbDhcuZ4COuUgqNuqEw49k4wfTzIDrTTr2YxgLlqmX6vWDZUWdWeKa2RHmWUwN L0wOnTXySA2nSRZKPp7oZYHIsqKHX3w= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-DfuOKaTKP9O7_VFMHr_Jyg-1; Wed, 12 Jul 2023 06:04:54 -0400 X-MC-Unique: DfuOKaTKP9O7_VFMHr_Jyg-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b704f6bbeaso69621791fa.2 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=jgS00Ma7IPdROiH5LVn1WTfTvoPfrqAljSdZp7F2GSXnQzFTnaG0yhNtvSCUkcU35k ccgWyodIH3QtvqISuZKjwZ48PcTih6LwgI42EVXuEb7IM+fINLuUc7lfRCy98kTk6EIj H3Hzo6wLIQR8YzU1zLIyYgeMtR+82ovQBdWdw8I1H/xOaS+g6mTFJ5fMcXBUOT/iU0Kr /xKwmhgOjRurASW7NIRtpBwXJ9kmYwuoWzLrz4ZoJfFOrG9BBhfCf+eHsWDBcjOxSihY GfKc9ZgthYRWR/vFFM4esuTq4AsPih9pJHdlayLKcxw16Fpf3VM0ZexVUfntgmdLVYVt YGUA== X-Gm-Message-State: ABy/qLaPqwVs81NEyveQLTql9KDlFtEeDqdLBaxT+ZZwvYCtRU2gZsXI hziR0Vng3oxdJMcjQ/z/ovzSq8Zgc312g76vAEbV8229fBbDl316J4VaCkkh+8fVnJjrNkEodKQ 2acMzmuBNRO2nLlWfDdHzRYZiadH/AsnyhcqpiQJfYg== X-Received: by 2002:a2e:9208:0:b0:2b6:f009:921a with SMTP id k8-20020a2e9208000000b002b6f009921amr14290772ljg.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.0 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=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: 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 >