From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by sourceware.org (Postfix) with ESMTPS id 755C0385773A for ; Fri, 1 Sep 2023 13:00:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 755C0385773A 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-vs1-xe2e.google.com with SMTP id ada2fe7eead31-44d426d0e05so918679137.0 for ; Fri, 01 Sep 2023 06:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1693573208; x=1694178008; darn=gcc.gnu.org; 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=+qNK7qJc+X9XFzyISfG4e7TDslE1tS+zRHq+fb6jRdw=; b=YUHmGL2edokxpNANBE3rmWf4Bqx5ukkN8zVCaYmwP9ks1UIA29XTRGReKedGbrV2hj BgOMqhj3iBdmltWl5dAM1G9KoXC3g2wdmnxttiT4lopjUEKdzhOoaZQE1v/CplORfB3b GF37HDI3tWifFcY/xa0PkssjjMe4ycIEvEOPk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693573208; x=1694178008; 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=+qNK7qJc+X9XFzyISfG4e7TDslE1tS+zRHq+fb6jRdw=; b=ZgkpL0xymDr/q0G/DYbjaBaKqHh/jtvK8FdlWPKZhc91FBlx9b6R+0h1J6/sCdY7Go 3BUqAwZS22xbZSJKajLaixW3cU1sL2c8zd87F3FanbwmL1WeaAvbm4j1IS2f8jV5MwmX lqgy/3SQlodfD1da4Y0Js7qvBgLgPZdGxsl7MI3P25WNxQH8MVZuOJmbH+fyVyU+l8nY D8lP3ar+eKWHgwiyXfcGu+3yN7zXpZR7FUeq93T7q3lPLQZU7Kzoau7mfXeapqZ+2aje FMVCI3PYce2wwqokwEzwW2LYooN1nrq4sa2Y0pXo4RHapml+x4Xhl1b9V3H+3cabjRr2 tMyA== X-Gm-Message-State: AOJu0YyTOhvpSMnrqyJIZ9EOIFDdustgHgQlI3GfAOw8+ahqK9DWZMhV k3GDz7MlsuQX95R4qmGdnI47ZKFr5Hi56Y1AF02mRw== X-Google-Smtp-Source: AGHT+IGSwntG2Mybla/YmTyGWYxMqhwU/zDikzbCnWbGd5Ykt838Nf3ZMgI1hbjLJnHsuGFkDqQ7ceDlcUx7jM3i8g0= X-Received: by 2002:a67:e8d4:0:b0:44d:547d:4607 with SMTP id y20-20020a67e8d4000000b0044d547d4607mr2248772vsn.35.1693573207854; Fri, 01 Sep 2023 06:00:07 -0700 (PDT) MIME-Version: 1.0 References: <20230708052335.65718-1-kmatsui@gcc.gnu.org> <20230708052335.65718-2-kmatsui@gcc.gnu.org> In-Reply-To: <20230708052335.65718-2-kmatsui@gcc.gnu.org> From: Ken Matsui Date: Fri, 1 Sep 2023 06:00:00 -0700 Message-ID: Subject: [PING][PATCH v3 2/2] libstdc++: use new built-in trait __is_array To: Jonathan Wakely Cc: gcc-patches , "libstdc++" , Ken Matsui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.9 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 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: Ping for the use of __is_array built-in. Sincerely, Ken Matsui On Fri, Jul 7, 2023 at 10:24=E2=80=AFPM Ken Matsui wr= ote: > > This patch lets libstdc++ use new built-in trait __is_array. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_array): Use __is_array built-in tra= it. > (is_array_v): Likewise. > > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/std/type_traits | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/= std/type_traits > index 0e7a9c9c7f3..f2a3a327e7d 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -503,6 +503,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { }; > > /// is_array > +#if __has_builtin(__is_array) > + template > + struct is_array > + : public __bool_constant<__is_array(_Tp)> > + { }; > +#else > template > struct is_array > : public false_type { }; > @@ -514,6 +520,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > template > struct is_array<_Tp[]> > : public true_type { }; > +#endif > > template > struct __is_pointer_helper > @@ -3161,12 +3168,17 @@ template > template > inline constexpr bool is_floating_point_v =3D is_floating_point<_Tp>::= value; > > +#if __has_builtin(__is_array) > +template > + inline constexpr bool is_array_v =3D __is_array(_Tp); > +#else > template > inline constexpr bool is_array_v =3D false; > template > inline constexpr bool is_array_v<_Tp[]> =3D true; > template > inline constexpr bool is_array_v<_Tp[_Num]> =3D true; > +#endif > > template > inline constexpr bool is_pointer_v =3D is_pointer<_Tp>::value; > -- > 2.41.0 >