[PATCH] Improvements to valid range checks in debug mode

Jonathan Wakely jwakely.gcc@gmail.com
Mon Aug 16 19:25:44 GMT 2021


On Fri, 13 Aug 2021 at 18:10, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> I just come back to this email and it sounds like the right moment to
> commit it.

Ah yes, thanks for the reminder!

I'll push it tomorrow.

>
> On 27/02/20 2:06 pm, Jonathan Wakely wrote:
> > These should wait for stage 1 but I'm posting them now for comment.
> >
> > With the change to __gnu_debug::__valid_range we now get a debug
> > assertion for:
> >
> >   std::string s;
> >   std::min_element(std::string::iterator{}, s.end());
> >
> > where previously it would just crash with undefined behaviour.
> >
>


More information about the Libstdc++ mailing list