public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: "Arsen Arsenović" <arsen@aarsen.me>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH 1/4] libstdc++: Harmonize <version> and other headers
Date: Wed, 5 Apr 2023 13:09:39 +0100	[thread overview]
Message-ID: <CACb0b4kWTZnHV9ccDCbXVwc9anb=eW_h--ey0g+83KNJW6DGNQ@mail.gmail.com> (raw)
In-Reply-To: <86lej6a7dx.fsf@aarsen.me>

On Wed, 5 Apr 2023 at 12:36, Arsen Arsenović <arsen@aarsen.me> wrote:
>
>
> Jonathan Wakely <jwakely@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>.


  reply	other threads:[~2023-04-05 12:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 23:09 Arsen Arsenović
2023-04-04 23:09 ` [PATCH 2/4] libstdc++: Add a test for <version> FTM redefinitions Arsen Arsenović
2023-04-05 10:59   ` Jonathan Wakely
2023-04-05 11:31     ` Arsen Arsenović
2023-04-05 11:38       ` Arsen Arsenović
2023-04-05 12:07         ` Jonathan Wakely
2023-04-04 23:09 ` [PATCH 3/4] libstdc++: Downgrade DEBUG to ASSERTIONS when !HOSTED Arsen Arsenović
2023-04-05 11:00   ` Jonathan Wakely
2023-04-04 23:09 ` [PATCH 4/4] libstdc++: Fix some freestanding test failures Arsen Arsenović
2023-04-05 11:08   ` Jonathan Wakely
2023-04-05 11:28     ` Arsen Arsenović
2023-04-05 10:52 ` [PATCH 1/4] libstdc++: Harmonize <version> and other headers Jonathan Wakely
2023-04-05 11:33   ` Arsen Arsenović
2023-04-05 12:09     ` Jonathan Wakely [this message]
2023-04-05 12:10       ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACb0b4kWTZnHV9ccDCbXVwc9anb=eW_h--ey0g+83KNJW6DGNQ@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=arsen@aarsen.me \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).