[PATCH] Improvements to valid range checks in debug mode

Jonathan Wakely jwakely@redhat.com
Thu Feb 27 13:06:00 GMT 2020


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 6815 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20200227/4f02f4d3/attachment.bin>


More information about the Gcc-patches mailing list