From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2f.google.com (mail-vk1-xa2f.google.com [IPv6:2607:f8b0:4864:20::a2f]) by sourceware.org (Postfix) with ESMTPS id E7E8E3858401 for ; Wed, 12 Jul 2023 19:36:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7E8E3858401 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-vk1-xa2f.google.com with SMTP id 71dfb90a1353d-47e106c3f56so2692486e0c.2 for ; Wed, 12 Jul 2023 12:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1689190572; x=1691782572; 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=gwY2Yg6ysdtBjEziXOdeV8TKP5xz7d7Mn3xQz6TNRvo=; b=K1HQmdq5tRhwbiRvY90fdkSMxuubwSFYay+I/Jyau0wP0ywsJgfs984ddi6V3T3DC6 MRkh4LcnfUhHcZZzmITQPW4aG1hoS5M0ncot0gcAMcnjvAFyTA97ZiM6ApLxqG1Lt3Mm 4nvgIq6eixyYvI7vQF81a3SLE29jCR4aGJ3us= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689190572; x=1691782572; 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=gwY2Yg6ysdtBjEziXOdeV8TKP5xz7d7Mn3xQz6TNRvo=; b=GhRMIbH6c8BpJbvTeykvGDISCO3XuEOOLc/Iviiyq2/LHd05hAoE3pdM0x0QyNOJsK MzJCmZbw9Vlp00Xy5yX5Wb7AXBNuKpzC2SomTby5WXfWufgxImeafmKxBD0ji6/LK+1S TGuGR+VP4aMME+ziyn5pbuYqOjjCkE8+c2FBfKe9pCkkAUeu4qL/S1mEtnxOl2JPphzH Vph5+zCgNNNzkJ03USOFI8oMSVEUmYGJj0aAnUBIU+H0BMbtoD7H2w4JEzXciOCYr1Bg kBrPbvvIsg95afKxpDFLcueayLapwMMhBB6QZ5s3f3fhUicVcgBuGpZrcOQGCf4H4A6g 6eQw== X-Gm-Message-State: ABy/qLZm4kztgJ/xWyyBWHCMCz1mxhFU8mLVHfKIThltB785GMk+i/X3 f1fBlTjXMezsVt1PRvEBsRGbwjCmM04CR2Wb4IenWw== X-Google-Smtp-Source: APBJJlGNSbN6UUNQPqsBdHkpF8gsrYfV+eC8BFi5GkQhj0uj2Kf/KySotkCc1LMd7icOGIn4EXMzz6CzX11cZNjcvzM= X-Received: by 2002:a1f:d0c2:0:b0:471:b3f3:9bf9 with SMTP id h185-20020a1fd0c2000000b00471b3f39bf9mr10086894vkg.6.1689190571877; Wed, 12 Jul 2023 12:36:11 -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 12:35:56 -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: Jonathan Wakely , Ken Matsui , gcc-patches , "libstdc++" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.8 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 12:23=E2=80=AFPM Jonathan Wakely wrote: > > > > 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 f= or 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. Thank you! >> >> > > >> > > 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/inc= lude/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>>::t= ype >> > > { }; >> > > +#endif >> > > >> > > /// is_compound >> > > template >> > > @@ -3204,8 +3211,15 @@ template >> > > inline constexpr bool is_fundamental_v =3D is_fundamental<_Tp>::v= alue; >> > > 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 >> > > >> >