From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 9852A3858C50 for ; Wed, 5 Apr 2023 12:09:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9852A3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680696594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j3GRyI2m6KGpg1TzqdtxQZ/7eE5aKc2425862ncYGpU=; b=iJLrYG0nfnncAkYky+EXBClE8u5Gzu9bLtK/IV+RKLBMcrX1RDLwZX4CVqShqIk/jml3qU 2ApfiNUtsi9UE1djvAVXh1xCloFwFYXlcnP14onE0s3f3NCrmt2aCvlZthOR26k5Avb6Qn BwIgk3MJQiOT7MkktUqnggSgn3Wktgs= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-TE23WNUQMnO91_DUbCEmyA-1; Wed, 05 Apr 2023 08:09:53 -0400 X-MC-Unique: TE23WNUQMnO91_DUbCEmyA-1 Received: by mail-lj1-f197.google.com with SMTP id bj25-20020a2eaa99000000b002a4c905cd3dso7137501ljb.22 for ; Wed, 05 Apr 2023 05:09:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680696590; 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=j3GRyI2m6KGpg1TzqdtxQZ/7eE5aKc2425862ncYGpU=; b=1zmowTHT7tycWV14NgVyX/QHDo2WY8phoecgZrM8Ho6UsG23Ki51BrFe4j6iclHxmO wm5pvJRlHt/VdatdBTaSlwYZAU/+X9jNLK+9OCfJTqRVrtwD2WM1SOtlHS79NpyWW6Xc ITQ+n+6QrF82EpYA2Bdzi2eX1UfcavF6OQFobPoknm9cR4y03jcMPSCUCSokPzoUvDUR OjlHJlgfHun92AxlK1x8ZODl24iVBOm6suDk59nFNutSct1oUYe2DNNmFZFO5ngQqoNc hEUwwPnynI7SgBu+bfEjlVWW+bGXTVeaWFbAixaiLR2595mfoovrpVAs2VZqo1cIkwnl Ju6Q== X-Gm-Message-State: AAQBX9ejg4ixCAwOM7zx9nbQ7dflIu+pr7X+MOQztyiOoJakYiiyvEcf y2sx7y8xrwCweNXqNP4op8dl+3nohlHDPlX6fIzbA6eQr2grhLnR/Sb5N2lsVyiQrnbyz7NuhOQ oARjUNEJf1dcCBFmSwatewd9jdYjS9jA= X-Received: by 2002:a2e:b04a:0:b0:2a6:cb8f:c7a8 with SMTP id d10-20020a2eb04a000000b002a6cb8fc7a8mr237626ljl.9.1680696590799; Wed, 05 Apr 2023 05:09:50 -0700 (PDT) X-Google-Smtp-Source: AKy350aEnzpT/icY34bVmcHAyvpANvNuI0mQoO5esj3kiuvBZyIXxveFO6dwCdN32GDsAcTemOzGDynTiq9nVVCOFyo= X-Received: by 2002:a2e:b04a:0:b0:2a6:cb8f:c7a8 with SMTP id d10-20020a2eb04a000000b002a6cb8fc7a8mr237617ljl.9.1680696590496; Wed, 05 Apr 2023 05:09:50 -0700 (PDT) MIME-Version: 1.0 References: <20230404230950.158556-1-arsen@aarsen.me> <86lej6a7dx.fsf@aarsen.me> In-Reply-To: <86lej6a7dx.fsf@aarsen.me> From: Jonathan Wakely Date: Wed, 5 Apr 2023 13:09:39 +0100 Message-ID: Subject: Re: [PATCH 1/4] libstdc++: Harmonize and other headers To: =?UTF-8?Q?Arsen_Arsenovi=C4=87?= Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 Wed, 5 Apr 2023 at 12:36, Arsen Arsenovi=C4=87 wrote: > > > Jonathan Wakely writes: > > >> [snip...] > >>+/* Duplicate definition with unique_ptr.h. */ > >>+#if __cplusplus > 202002L && defined(__cpp_constexpr_dynamic_alloc) > >>+# define __cpp_lib_constexpr_memory 202202L > >>+#elif __cplusplus > 201703L > >>+# include > > > > Including is unrelated to the FTM, and should always be > > done for >=3D C++17, but this change means it's not included for the > > first block. > > > > Please leave the #include with the _Safe_iterator_base declaration. > > Fixed: > > diff --git a/libstdc++-v3/include/bits/ptr_traits.h b/libstdc++-v3/includ= e/bits/ptr_traits.h > index dc42a743c96..8a919ec1090 100644 > --- a/libstdc++-v3/include/bits/ptr_traits.h > +++ b/libstdc++-v3/include/bits/ptr_traits.h > @@ -34,12 +34,15 @@ > > #include > > +/* Duplicate definition with unique_ptr.h. */ > +#if __cplusplus > 202002L && defined(__cpp_constexpr_dynamic_alloc) > +# define __cpp_lib_constexpr_memory 202202L > +#elif __cplusplus > 201703L > +# define __cpp_lib_constexpr_memory 201811L > +#endif > + > #if __cplusplus > 201703L > #include > -# ifndef __cpp_lib_constexpr_memory > -// Defined to a newer value in bits/unique_ptr.h for C++23 > -# define __cpp_lib_constexpr_memory 201811L > -# endif > namespace __gnu_debug { struct _Safe_iterator_base; } > #endif > > >> [snip...] > > > > Pleae keep them in alphabetical order (within their relevant > > blocks/groups). > > I didn't even notice the ordering - apologies. > > Updated patch: > > > The testsuite is running on my end, so the above is technically not > tested yet, but it should be the same logic unless I reordered something > wrong. OK for trunk, thanks I note that this moves __cpp_lib_to_chars from being defined for C++17 to being defined for C++14. That's OK, because it's actually true for libstdc++ as noted by the comment at the top of .