From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id D8A973858D20; Wed, 12 Jul 2023 19:23:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D8A973858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-992b2249d82so1214166b.1; Wed, 12 Jul 2023 12:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689189810; x=1691781810; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6/CUj6p524Vj3OcbYpmAQ3WTxte6nmYgcuNBpxV60tQ=; b=mkEKcQClxZaGE8uOL945Ia33GPlWy9kZjbPZYcakZPJlqulJjbBRw7yjyqjxT4he5Q s2bsS04Hp+rSIA6ABl96EUOwIx8zCBNe7GjiurzV8im9LnEgQOQminU04qZgQCmPTO2A lVgPEnIOzKOvLqNoIJiYQcQCHa4wFUvOkPWy+nbK/Ye5aPj4taBDhMFFLirT306QeKJO 4EgvOkb8DK9fQjV10AuQSFxkRfHOCsSpmdjznRMIkiUYuiWABfs3TQ0T0SWk3xtUVsrB 9+g33i9irXqT88O9xtENTWwl1l4I8W8Vutuogbijh1PnBgYVqT5KQ4uPvdbSco3ACaCK TKAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689189810; x=1691781810; 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=6/CUj6p524Vj3OcbYpmAQ3WTxte6nmYgcuNBpxV60tQ=; b=UIQwVHDlz2YCncgrQ+2uldZJNn/qlH0L5lbDCR39SEyFhsrzckkh66H87FPHmXc9iM SUoIVNuEmMeisTeA/m3vfljnFDoSgECikINeQi79skDUhxea1QQ0xA8Dfso4AXUL9w8F f7NSf3t781EuOEdSgVIkhqBx3NMP+te9zxzRAx+k7QvWsZE38qcxFSUndUVKmQZOw24U yD/JKbRxhi4kZIBbTnCPDzy8P85PTMx8+ToEtPv9/z1PslNY+KTePrDnaESj83Je8Nle z81fRz9EzK3kUJfouV3kWinRp+mhhMvAFLgTBmjTO+t+1jOLPdowwuz3anwjudyUrsgY zr4Q== X-Gm-Message-State: ABy/qLav3LCPjljXLzLTrqJywE3vXjlGmEfpHmKZfNz2wdSj+EYBUwkc mRAUGTJ0ZhhFCg7s35PPmc5goyiyPk0d3AVK15PO8CXD X-Google-Smtp-Source: APBJJlHBkUvqDmSHO17dfWOd15HHCD/80a0xNsu0l3FdR7aMcWTx+DxJCYPCnvj2UA6/5bJJO+JNuc8ARKZMcVVv9SY= X-Received: by 2002:a17:906:1089:b0:993:ff4b:5a0c with SMTP id u9-20020a170906108900b00993ff4b5a0cmr12324677eju.30.1689189809566; Wed, 12 Jul 2023 12:23:29 -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: Jonathan Wakely Date: Wed, 12 Jul 2023 20:23:17 +0100 Message-ID: Subject: Re: [PATCH v2 2/2] libstdc++: use new built-in trait __is_scalar for std::is_scalar To: Ken Matsui Cc: Jonathan Wakely , Ken Matsui , gcc-patches , "libstdc++" Content-Type: multipart/alternative; boundary="0000000000008eb98706004f26ac" X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,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: --0000000000008eb98706004f26ac Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 12 Jul 2023, 19:33 Ken Matsui via Libstdc++, wrote: > 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? > Only this patch. I cannot approve compiler changes, I'm only a reviewer for libstdc++. > > 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? > The other way around, as Xi Ruoyao said. > Also, can I tweak the commit message without being approved again, > such as attaching the benchmark result? > Yes, that's fine. > > > > > > 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/include/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>>::ty= pe > > > { }; > > > +#endif > > > > > > /// is_compound > > > template > > > @@ -3204,8 +3211,15 @@ template > > > inline constexpr bool is_fundamental_v =3D is_fundamental<_Tp>::va= lue; > > > 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 > > > > > > --0000000000008eb98706004f26ac--