On Wed, 5 Apr 2023 at 12:36, Arsen Arsenović <ar...@aarsen.me> wrote: > > > Jonathan Wakely <jwak...@redhat.com> 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 <concepts> > > > > Including <concepts> is unrelated to the FTM, and should always be > > done for >= 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/include/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 <bits/move.h> > > +/* 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 <concepts> > -# 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 <charconv>.