From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 1E2E43858C53; Mon, 20 Mar 2023 07:51:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E2E43858C53 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1679298693; bh=XNFyFuxAk211j2/y+bgU90M3Cv4y2rBH3qrCN0fcVCA=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ATaWfGkb8W62amGWoBSPmWDe6s+YMxxQFLyDU8g6ZB6fHcG/wGyqpKgZ0xuRpQg59 gzoDTSU/1bx+0iXn07HxXMDme2U51npaY2bWOvBxpnDZRBbhfwE0Wsn0/TAx3pA6p8 dCODgLAabYBTNeZIlkhAwwlviF62ibQTx3Gw9yK0= Received: from [IPv6:240e:358:11f7:6300:dc73:854d:832e:4] (unknown [IPv6:240e:358:11f7:6300:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 1D83D65C75; Mon, 20 Mar 2023 03:51:27 -0400 (EDT) Message-ID: <45e80ead7387ef50026922c217a33719bfc66a4a.camel@xry111.site> Subject: Re: [PATCH] libstdc++: use new built-in trait __is_reference From: Xi Ruoyao To: Ken Matsui Cc: gcc-patches@gcc.gnu.org, Patrick Palka , libstdc++@gcc.gnu.org Date: Mon, 20 Mar 2023 15:51:22 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,LIKELY_SPAM_FROM,SPF_HELO_PASS,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: On Mon, 2023-03-20 at 00:30 -0700, Ken Matsui wrote: > I see. Thank you! Please continue to read. I guess you missed some inline comments from me... >=20 > On Mon, Mar 20, 2023 at 12:26=E2=80=AFAM Xi Ruoyao w= rote: > >=20 > > You need to CC libstdc++@gcc.gnu.org=C2=A0for any patches touching > > libstdc++. > >=20 > > On Sat, 2023-03-18 at 21:21 -0700, Ken Matsui via Gcc-patches wrote: > > > libstdc++-v3/ChangeLog: > > >=20 > > > * include/std/type_traits (is_reference): Use __is_reference > > > built-in > > > trait. > >=20 > > Bad ChangeLog format.=C2=A0 You should have a tab (not 4 or 8 spaces, n= or > > nothing) to indent the ChangeLog content. > >=20 > > Is there any benefit to use a builtin, instead of the existing > > implementation?=C2=A0 I can see no but maybe I'm stupid. > >=20 > > > --- > > > diff --git a/libstdc++-v3/include/std/type_traits > > > b/libstdc++-v3/include/std/type_traits > >=20 > > The patch fails to apply.=C2=A0 It seems because your mail client > > inserted an > > additional newline before "b/".=C2=A0 Try to use git-send-email or > > configure > > the mail client properly. > >=20 > > > index 2bd607a8b8f..18408d8ceb6 100644 > > > --- a/libstdc++-v3/include/std/type_traits > > > +++ b/libstdc++-v3/include/std/type_traits > > > @@ -639,6 +639,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > =C2=A0=C2=A0 // Composite type categories. > > >=20 > > > =C2=A0=C2=A0 /// is_reference > > > +#if __has_builtin(__is_reference) > > > +=C2=A0 template > > > +=C2=A0=C2=A0=C2=A0 struct is_reference > > > +=C2=A0=C2=A0=C2=A0 : public integral_constant > >=20 > > If a patch depends on another patch not applied yet, sent them in a > > series.=C2=A0 Or people are puzzled because when this patch is applied > > alone, > > the code fails to build. > >=20 > > > +=C2=A0=C2=A0=C2=A0 { }; > > > +#else > > > =C2=A0=C2=A0 template > > > =C2=A0=C2=A0=C2=A0=C2=A0 struct is_reference > > > =C2=A0=C2=A0=C2=A0=C2=A0 : public false_type > > > @@ -653,6 +659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > =C2=A0=C2=A0=C2=A0=C2=A0 struct is_reference<_Tp&&> > > > =C2=A0=C2=A0=C2=A0=C2=A0 : public true_type > > > =C2=A0=C2=A0=C2=A0=C2=A0 { }; > > > +#endif > > >=20 > > > =C2=A0=C2=A0 /// is_arithmetic > > > =C2=A0=C2=A0 template > >=20 > > -- > > Xi Ruoyao > > School of Aerospace Science and Technology, Xidian University --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University