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 751BB385B52D for ; Fri, 1 Sep 2023 13:00:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 751BB385B52D 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-79414715edeso575246241.0 for ; Fri, 01 Sep 2023 06:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1693573225; x=1694178025; 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=iIFCIiRszMIS+KdfQabRQ6L2rAy2YIggdDQxpeycP+I=; b=YOkaG3kHdwNWTHpBe3UQoZQDEZrf71wcHEuptMzHvCO5TrmAZQDaOJvzvRTZM/05wR O+167Qo3peg5RWgTTXNfywXnJ5+Y9x6Mz9XbYkPyVJ9VWI9S+wouc8av1uqRuCPW0Is7 jR+b1C6Wveg+P/Bng/0OtUeMeY9lZ4L/oGsPc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693573225; x=1694178025; 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=iIFCIiRszMIS+KdfQabRQ6L2rAy2YIggdDQxpeycP+I=; b=QkuD9wRIaqaCcGFoJRH+kbh7K5oI9C2ft/KAYtnCFZ5WHjL4YQ5pY4aUENGfRF4jKw +oSqy+ifebvW8zjgfYE1mkwGgjQjP6fUgHmWT/XYDhEYUN9vBvDmEgzqM2oacyqkWTyQ KLPX3whsaf7rCDVwSPvT+vN6XMeKNtOuaq/kDq+JkURuJ7h8d/coqc+nazTaiQ3d1kwx HI/XO3VfDq28dt2qDi65DMQYjzc7vhStzaO1MNcz0Y6a5i9xyTpaVSP8d64n32/G4+jW bs3ncotRUq3vYhkLXLbtFyjxEk7eZh6Akf9PUG3K+04rQ+95OTVtWLWvTTRj+PSY1LRb FYzA== X-Gm-Message-State: AOJu0Yxc3ByS3kfWX1JHz2AmyiuSPlFJ+gf+zr0or3Y4IIO4Pjijiv11 yrl9Qu0X6Z24VV8SgAr+NwuUrP7M2JdEejSV+tj6rg== X-Google-Smtp-Source: AGHT+IHMu98LZDtia8pE45ttOwd96S4ja9jAxsaIfLP6dNvC9tog5TF+3REFUO0eG349WfOBjCXha7GVZ9xojFaph7E= X-Received: by 2002:a67:efd6:0:b0:445:202:d278 with SMTP id s22-20020a67efd6000000b004450202d278mr2379064vsp.32.1693573225387; Fri, 01 Sep 2023 06:00:25 -0700 (PDT) MIME-Version: 1.0 References: <20230708051137.63707-1-kmatsui@gcc.gnu.org> <20230713023731.15571-1-kmatsui@gcc.gnu.org> <20230713023731.15571-6-kmatsui@gcc.gnu.org> In-Reply-To: <20230713023731.15571-6-kmatsui@gcc.gnu.org> From: Ken Matsui Date: Fri, 1 Sep 2023 06:00:00 -0700 Message-ID: Subject: [PING][PATCH v10 5/5] libstdc++: Make std::is_object dispatch to new built-in traits 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 std::is_object. Sincerely, Ken Matsui On Wed, Jul 12, 2023 at 7:42=E2=80=AFPM Ken Matsui wr= ote: > > This patch gets std::is_object to dispatch to new built-in traits, > __is_function and __is_reference. > > libstdc++-v3/ChangeLog: > * include/std/type_traits (is_object): Use new built-in traits, > __is_function and __is_reference. > (is_object_v): Likewise. > > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/std/type_traits | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/= std/type_traits > index 7ef50a2e64f..4ff025b09fa 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -682,11 +682,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { }; > > /// is_object > +#if __has_builtin(__is_function) && __has_builtin(__is_reference) \ > + && __has_builtin(__is_void) > + template > + struct is_object > + : public __bool_constant + __is_void(_Tp))> > + { }; > +#else > template > struct is_object > : public __not_<__or_, is_reference<_Tp>, > is_void<_Tp>>>::type > { }; > +#endif > > template > struct is_member_pointer; > @@ -3233,8 +3242,16 @@ template > inline constexpr bool is_arithmetic_v =3D is_arithmetic<_Tp>::value; > template > inline constexpr bool is_fundamental_v =3D is_fundamental<_Tp>::value; > + > +#if __has_builtin(__is_function) && __has_builtin(__is_reference) > +template > + inline constexpr bool is_object_v > + =3D !(__is_function(_Tp) || __is_reference(_Tp) || is_void<_Tp>::val= ue); > +#else > template > inline constexpr bool is_object_v =3D is_object<_Tp>::value; > +#endif > + > template > inline constexpr bool is_scalar_v =3D is_scalar<_Tp>::value; > template > -- > 2.41.0 >