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 E691D3858C2B; Mon, 20 Mar 2023 07:26:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E691D3858C2B 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=1679297174; bh=Ykz3NiU9ebCAPZ2LqdiIs8bPFt9odM+bg1pRns3QHg0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=H1JJlH23ozYnFXki2p2SS2Hz+2XpKYQWdK+j0vwjUsKvCOQbby+ugsv9MUoiv4/QP QoPAtfpgfeOJYRPFesxYII76yI5zhUflV+d2xyoRnpOcjoCO+5ghhhnB5to8sSxlfl V+PveI8pleltcm1dQrLzribX/BYkeml8FHZfeY9E= 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) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id EFD65663B0; Mon, 20 Mar 2023 03:25:58 -0400 (EDT) Message-ID: Subject: Re: [PATCH] libstdc++: use new built-in trait __is_reference From: Xi Ruoyao To: Ken Matsui , gcc-patches@gcc.gnu.org Cc: Patrick Palka , libstdc++@gcc.gnu.org Date: Mon, 20 Mar 2023 15:25:37 +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: You need to CC libstdc++@gcc.gnu.org for any patches touching libstdc++. 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. Bad ChangeLog format. You should have a tab (not 4 or 8 spaces, nor nothing) to indent the ChangeLog content. Is there any benefit to use a builtin, instead of the existing implementation? I can see no but maybe I'm stupid. > --- > diff --git a/libstdc++-v3/include/std/type_traits > b/libstdc++-v3/include/std/type_traits The patch fails to apply. It seems because your mail client inserted an additional newline before "b/". Try to use git-send-email or configure the mail client properly. > 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 If a patch depends on another patch not applied yet, sent them in a series. Or people are puzzled because when this patch is applied alone, the code fails to build. > +=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