From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Stephan Bergmann <sberg.fun@gmail.com>
Cc: libstdc++ <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>,
"François Dumont" <frs.dumont@gmail.com>,
"Jonathan Wakely" <jwakely@redhat.com>
Subject: Re: [PATCH][_GLIBCXX_DEBUG] Fix std::__niter_base behavior
Date: Mon, 19 Feb 2024 08:21:04 +0000 [thread overview]
Message-ID: <CAH6eHdTzZi6goUqM7QNjZAsYc1EvowbsV=c9qwKMkMf2tdTWqA@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdRTWHkOarqnmuH6m+Ow-AEuB8QN7JNo=OG3UDuSYhHoRA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
On Mon, 19 Feb 2024, 08:12 Jonathan Wakely, <jwakely.gcc@gmail.com> wrote:
>
>
> On Mon, 19 Feb 2024, 07:08 Stephan Bergmann, <sberg.fun@gmail.com> wrote:
>
>> On 2/17/24 15:14, François Dumont wrote:
>> > Thanks for the link, tested and committed.
>>
>> I assume this is the cause for the below failure now,
>>
>
> Yes, the new >= C++11 overload of __niter_base recursively unwraps
> multiple layers of wrapping, so that a safe iterator wrapping a normal
> iterator wrapping a pointer is unwrapped to just a pointer. But then
> __niter_wrap doesn't restore both layers.
>
Actually that's not the problem. __niter_wrap would restore both layers,
except that it uses __niter_base itself:
> 347 | { return __from + (__res - std::__niter_base(__from)); }
> | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
And it seems to be getting called with the wrong types. Maybe that's just a
bug in std:: erase or maybe niter_wrap needs adjusting.
I'll check in a couple of hours if François doesn't get to it first.
I have to wonder how this wasn't caught by existing tests though.
next prev parent reply other threads:[~2024-02-19 8:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 18:39 François Dumont
2024-02-14 19:44 ` Jonathan Wakely
2024-02-14 21:48 ` François Dumont
2024-02-15 13:17 ` Jonathan Wakely
2024-02-15 18:38 ` François Dumont
2024-02-15 18:40 ` Jonathan Wakely
2024-02-17 14:14 ` François Dumont
2024-02-19 7:07 ` Stephan Bergmann
2024-02-19 8:12 ` Jonathan Wakely
2024-02-19 8:21 ` Jonathan Wakely [this message]
2024-02-19 18:39 ` François Dumont
2024-02-20 18:42 ` François Dumont
2024-02-20 19:27 ` 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='CAH6eHdTzZi6goUqM7QNjZAsYc1EvowbsV=c9qwKMkMf2tdTWqA@mail.gmail.com' \
--to=jwakely.gcc@gmail.com \
--cc=frs.dumont@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely@redhat.com \
--cc=libstdc++@gcc.gnu.org \
--cc=sberg.fun@gmail.com \
/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).