[PATCH] Improvements to valid range checks in debug mode
François Dumont
frs.dumont@gmail.com
Fri Aug 13 17:09:58 GMT 2021
I just come back to this email and it sounds like the right moment to
commit it.
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