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 732E6385559A for ; Fri, 1 Sep 2023 13:00:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 732E6385559A 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-44dbd5011beso920626137.1 for ; Fri, 01 Sep 2023 06:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1693573219; x=1694178019; 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=dytZat3g27kXcuyN1zT3fFyWSZakkT+hYU/wnc7r2oI=; b=lHQWpwXSpWU09LEYF3baTZJK8Zj7dYBPh7VtStJyXvVwNbAx5ypMJPcZQtWoGXiXxt 3chVrMbdORGwDSCqLciBFkO1HwOzj8jGCYoO/gUYxTMy8jVcpbCgsOlxW7sThBazVF/j Fcjm/M0XWDqqDfSIGL0tbCKniPOdHGOiErBFI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693573219; x=1694178019; 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=dytZat3g27kXcuyN1zT3fFyWSZakkT+hYU/wnc7r2oI=; b=H42PIG1KVHlksbnQOnmozp3IUmCcynLH8ZzAC7IBDqBvo8bvajsEBW3j3ynVUHlYgD CjwcV01A1GOBue7c9DHfDv9zB0S+gYzpFgJ659tGvy4V+a1j2PgVYNX7heDJKBtP8Pxk AmNlvskA63MiW4MASBov7fuwUKOXTi3xwvZGjiwseY7pm5IAWO3zdoT0FCmJc7nlFZIf u+fSRJAlfl6RBeS1pxRYj4sYMbEnn2pRNFgb0snrf4dvTqru/Lyxd1vELnJBHLT75Vr+ I7GW/g/N4Xj89hsLIZY/ioJdZiwMDUcojeogn7e+aUn+q1qQT3xOZ5EnIwsuNFePZhm2 /w4g== X-Gm-Message-State: AOJu0YyF5w7ZpJQdabA/am23NuKlNaUrfurTweAr1OskJGj2zlDFt/+O VrTBYiZ7/Ve7EQSRMR/J/RWId+ibgXKREl7FcTLYEb/7kms6YCfA X-Google-Smtp-Source: AGHT+IE6naeiq8vupKxOSpQ/ktS4P5HuB6wTSX9tua69zyhxCIVGlely5uHchmPENP4pbrnsvxJI5a1fzWftsbJ30Pc= X-Received: by 2002:a05:6102:2454:b0:44e:d28f:e49c with SMTP id g20-20020a056102245400b0044ed28fe49cmr2443121vss.23.1693573218408; Fri, 01 Sep 2023 06:00:18 -0700 (PDT) MIME-Version: 1.0 References: <20230708052625.66538-1-kmatsui@gcc.gnu.org> <20230708052625.66538-2-kmatsui@gcc.gnu.org> In-Reply-To: <20230708052625.66538-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_const 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=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: Ping for the use of __is_const built-in. Sincerely, Ken Matsui On Fri, Jul 7, 2023 at 10:27=E2=80=AFPM Ken Matsui wr= ote: > > This patch lets libstdc++ use new built-in trait __is_const. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_const): Use __is_const built-in tra= it. > (is_const_v): Likewise. > > 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..3a46eca5377 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -764,6 +764,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > // Type properties. > > /// is_const > +#if __has_builtin(__is_const) > + template > + struct is_const > + : public __bool_constant<__is_const(_Tp)> > + { }; > +#else > template > struct is_const > : public false_type { }; > @@ -771,6 +777,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > template > struct is_const<_Tp const> > : public true_type { }; > +#endif > > /// is_volatile > template > @@ -3210,10 +3217,17 @@ template > inline constexpr bool is_compound_v =3D is_compound<_Tp>::value; > template > inline constexpr bool is_member_pointer_v =3D is_member_pointer<_Tp>::= value; > + > +#if __has_builtin(__is_const) > +template > + inline constexpr bool is_const_v =3D __is_const(_Tp); > +#else > template > inline constexpr bool is_const_v =3D false; > template > inline constexpr bool is_const_v =3D true; > +#endif > + > template > inline constexpr bool is_volatile_v =3D false; > template > -- > 2.41.0 >