public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Jonathan Wakely <jwakely.gcc@gmail.com>,
	libstdc++ <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: _LIBCXX_DEBUG value initialized singular iterators assert failures in std algorithms [PR104316]
Date: Wed, 20 Mar 2024 19:10:54 +0100	[thread overview]
Message-ID: <faa61bca-657a-4eab-b72d-f958ef5203cb@gmail.com> (raw)
In-Reply-To: <CACb0b4koCg2c2ySdEPKerD_VhNi2PhmdQ_cs61PN357DrR8g3Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]

As proposed below I also updated gcc-13 branch.

     libstdc++: [_GLIBCXX_DEBUG] Define __cpp_lib_null_iterators

     _GLIBCXX_DEBUG has now fully N3344 compliant iterator checks, we 
can define
     __cpp_lib_null_iterators macros like the normal mode.

     libstdc++-v3/ChangeLog:

             * include/std/iterator (__cpp_lib_null_iterators): Define 
regardless of
             _GLIBCXX_DEBUG.
             * include/std/version (__cpp_lib_null_iterators): Likewise.

François


On 20/03/2024 10:02, Jonathan Wakely wrote:
> On Wed, 20 Mar 2024 at 05:59, François Dumont wrote:
>> Thanks to you doc:
>>
>>       libstdc++: [_GLIBCXX_DEBUG] Define __[glibcxx,cpp_lib]_null_iterators
>>
>>       _GLIBCXX_DEBUG has now fully N3344 compliant iterator checks, we
>> can define
>>       __glibcxx_null_iterators and __cpp_lib_null_iterators macros like
>> the normal
>>       mode.
>>
>>       libstdc++-v3/ChangeLog:
>>
>>               * version.def (null_iterators): Remove extra_cond.
>>               * version.h: Regenerate.
>>
>> Ok to commit ?
> Please don't bother talking about __glibcxx_null_iterators in the
> commit message, that's an implementation detail that always mirrors
> the standard-defined __cpp_lib_null_iterators one. The first line of
> the commit will be much easier to read without that.
>
> OK with that change, thanks.
>
>> I already noticed that GCC 13 has no version.h file so no backport question.
> It has no version.h but it still has the macros:
>
> include/std/iterator:# define __cpp_lib_null_iterators 201304L
> include/std/version:# define __cpp_lib_null_iterators 201304L
>
> Those definitions can be made to not depend on _GLIBCXX_DEBUG.
>

[-- Attachment #2: version_patch.txt --]
[-- Type: text/plain, Size: 1073 bytes --]

diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator
index 695e18e2c47..a0a8eac570b 100644
--- a/libstdc++-v3/include/std/iterator
+++ b/libstdc++-v3/include/std/iterator
@@ -67,7 +67,7 @@
 #endif
 #include <bits/range_access.h>
 
-#if __cplusplus >= 201402L && ! defined _GLIBCXX_DEBUG // PR libstdc++/70303
+#if __cplusplus >= 201402L
 # define __cpp_lib_null_iterators 201304L
 #endif
 
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index bd1bee0190d..ee515c4e66c 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -81,9 +81,7 @@
 #define __cpp_lib_integral_constant_callable 201304L
 #define __cpp_lib_is_final 201402L
 #define __cpp_lib_make_reverse_iterator 201402L
-#ifndef _GLIBCXX_DEBUG // PR libstdc++/70303
-# define __cpp_lib_null_iterators 201304L
-#endif
+#define __cpp_lib_null_iterators 201304L
 #define __cpp_lib_robust_nonmodifying_seq_ops 201304L
 #define __cpp_lib_transformation_trait_aliases 201304L
 #define __cpp_lib_transparent_operators 201510L

  reply	other threads:[~2024-03-20 18:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 20:07 _LIBCXX_DEBUG value initialized singular iterators assert failures in std algorithms Maciej Miera
2024-03-11 20:40 ` Jonathan Wakely
2024-03-12  0:54   ` Maciej Miera
2024-03-12  1:03     ` Jonathan Wakely
2024-03-12  9:52       ` Jonathan Wakely
2024-03-14 21:49         ` _LIBCXX_DEBUG value initialized singular iterators assert failures in std algorithms [PR104316] François Dumont
2024-03-16 12:16           ` François Dumont
2024-03-17 11:45             ` Jonathan Wakely
2024-03-17 16:52               ` François Dumont
2024-03-17 18:14                 ` François Dumont
2024-03-18  7:45                   ` Jonathan Wakely
2024-03-18 21:38                     ` François Dumont
2024-03-19  9:31                       ` Jonathan Wakely
2024-03-19 15:41                         ` Jonathan Wakely
2024-03-20  5:59                           ` François Dumont
2024-03-20  9:02                             ` Jonathan Wakely
2024-03-20 18:10                               ` François Dumont [this message]
2024-03-21  6:20                                 ` Jonathan Wakely
2024-03-18  7:45                 ` 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=faa61bca-657a-4eab-b72d-f958ef5203cb@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=jwakely@redhat.com \
    --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).