From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by sourceware.org (Postfix) with ESMTPS id 134B83858C62 for ; Wed, 12 Jul 2023 18:32:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 134B83858C62 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-ua1-x934.google.com with SMTP id a1e0cc1a2514c-794d1714617so2709625241.0 for ; Wed, 12 Jul 2023 11:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1689186767; x=1691778767; 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=y/uuuRaC5qFBCryxGgS8odt22VgeqdWhbirutdaDdqQ=; b=htreinydK3lQ7y6rwt5Wgm+8EFxORS8qXsPAETDk73jg2ukE4Z2PBdxv1oLTiD4sYf /NJvy1B1/3nZkhW0LXP5xhuNgpZvWUC8eyIdnFvq/QyCtBf0PULe6mtpIHuDVecn0S9F 5XKI8xrj/+IYY5UJM+y4L21UJ2XL1wG3Nat7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689186767; x=1691778767; 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=y/uuuRaC5qFBCryxGgS8odt22VgeqdWhbirutdaDdqQ=; b=Pl1NHXJ8lCfga1IMT/S2D733YqvFPfhEGNUpx7MOUybT0UnGashfsat6e+IBMwJ8+r MC/jE/8/0GuFreaSHk8VqJZCFu9t1KkDlMsEl2rbaVnnhNkf1VxyX+tr3JqQGMRR4wSt orQ+0BG9v8fe1q0m6b7Dh7fwT19ZazcIgqew8dUY0Kei6jXZeX9Jw3cjgYE7CCKPbXSK Eevgj0TCbiBGQKtscjQa84wwgeDoFqolkTk/hbqVj/784oTfHEVa1D12pH4GKPA76nPA vWU6Kv7anRsM6OtsLSQuMDx+Vx8hq9FqcjAzzVyIelAz1A54o7CQCzZ/Y92qyu5sbgeb vSDw== X-Gm-Message-State: ABy/qLYIcLUm+OCp+N4rcscwpzDJkidjVAEBPahZbI9OO0JqKXhXb0n+ bdeFxqPRMqZmiVHlC6bzkRN+P61pfSlOW5bs2ogYdg== X-Google-Smtp-Source: APBJJlGGa7DZ4iRHyMoq82/y30gtFvKBRZ3lgjsjAeW87J2W01lySnvQthPSFnt+y1QMx9HDEbeJSWY30lu6vIcaW78= X-Received: by 2002:a67:b142:0:b0:443:5d36:4a75 with SMTP id z2-20020a67b142000000b004435d364a75mr10718557vsl.31.1689186767372; Wed, 12 Jul 2023 11:32:47 -0700 (PDT) MIME-Version: 1.0 References: <20230708044539.61276-1-kmatsui@gcc.gnu.org> <20230708044539.61276-2-kmatsui@gcc.gnu.org> In-Reply-To: From: Ken Matsui Date: Wed, 12 Jul 2023 11:32:31 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] libstdc++: use new built-in trait __is_scalar for std::is_scalar To: Jonathan Wakely Cc: Ken Matsui , gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.0 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: On Wed, Jul 12, 2023 at 2:50=E2=80=AFAM Jonathan Wakely wrote: > > On Sat, 8 Jul 2023 at 05:47, Ken Matsui via Libstdc++ > wrote: > > > > This patch gets std::is_scalar to dispatch to new built-in trait > > __is_scalar. > > > > libstdc++-v3/ChangeLog: > > > > * include/std/type_traits (is_scalar): Use __is_scalar built-in > > trait. > > (is_scalar_v): Likewise. > > OK for trunk (conditional on the front-end change being committed > first of course). > Thank you for your review! Just to confirm, this approval does not include the [1/2] patch, does it? Or, did you approve this entire patch series? > conditional on the front-end change being committed first of course Does this mean we want to commit this [2/2] patch before committing the [1/2] patch in this case? Also, can I tweak the commit message without being approved again, such as attaching the benchmark result? > > > > Signed-off-by: Ken Matsui > > --- > > libstdc++-v3/include/std/type_traits | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/includ= e/std/type_traits > > index 0e7a9c9c7f3..bc90b2c61ca 100644 > > --- a/libstdc++-v3/include/std/type_traits > > +++ b/libstdc++-v3/include/std/type_traits > > @@ -678,11 +678,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > struct is_member_pointer; > > > > /// is_scalar > > +#if __has_builtin(__is_scalar) > > + template > > + struct is_scalar > > + : public __bool_constant<__is_scalar(_Tp)> > > + { }; > > +#else > > template > > struct is_scalar > > : public __or_, is_enum<_Tp>, is_pointer<_Tp>, > > is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type > > { }; > > +#endif > > > > /// is_compound > > template > > @@ -3204,8 +3211,15 @@ template > > inline constexpr bool is_fundamental_v =3D is_fundamental<_Tp>::valu= e; > > template > > inline constexpr bool is_object_v =3D is_object<_Tp>::value; > > + > > +#if __has_builtin(__is_scalar) > > +template > > + inline constexpr bool is_scalar_v =3D __is_scalar(_Tp); > > +#else > > template > > inline constexpr bool is_scalar_v =3D is_scalar<_Tp>::value; > > +#endif > > + > > template > > inline constexpr bool is_compound_v =3D is_compound<_Tp>::value; > > template > > -- > > 2.41.0 > > >