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 902F33858D38 for ; Wed, 5 Apr 2023 12:09:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 902F33858D38 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-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-Tfau55nWNhOJbnbY0TfE3g-1; Wed, 05 Apr 2023 08:09:53 -0400 X-MC-Unique: Tfau55nWNhOJbnbY0TfE3g-1 Received: by mail-lf1-f72.google.com with SMTP id s26-20020a19771a000000b004eb0fbbafa9so11611270lfc.8 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=XCvPihs0RTGR5ErNcQNLAheFwCQDdgjNSwmlDXb7LLPARA5zXCHIr8IUNMh9LMuM2j Q2XMUKdGBcJjywf/buzYr/R2kHHdEN5smzMGjCN7Qn5A+uaRIpOI6ILfwyPYV5F/WiW/ dNaBONiV+ppbqYzK8VznnZvUsigivAfDvEon2Gc4vOP/mUd7qfrGiilLMc4Bk2vvo75E xdCjeCAg0GT9mPpiAK0LcIVBLbSr26dyjbywgUjJOI2OEd66Vf+JAblZXp4SVuePbDMF DmJ1YcQTPWyP8RkcEwlEvVk7Faxls97hdpEB8aIU/ODpVClJhoc/bxFnK+s/wfGOszYw sN6g== X-Gm-Message-State: AAQBX9c/KM9Z0CQ95QNMfjdyDFy16Sqy/mUGihOeRGZkt7I1kgnc/bIj HykXAs7eXegpEIN9P6TXs+7LqUcfzdszg7HUKEpNrX63rbyzRfdbvoUdsd+k7FX/ZB35cmb1gMR 9lQ8f6VL90UptWL35deg+yKKsjzNhb6y1ww== X-Received: by 2002:a2e:b04a:0:b0:2a6:cb8f:c7a8 with SMTP id d10-20020a2eb04a000000b002a6cb8fc7a8mr237627ljl.9.1680696590800; 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.1 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 .