[Bug libstdc++/112314] Missing index assertions in basic_string_view
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 2 16:06:23 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112314
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jose Dapena Paz from comment #2)
> In any case, the failing test is actually passing -1, my understanding is
> that that one should always assert no matter what we are passing as const
> char*.
Yes but I'm not going to add a check for -1 just to make some unit test pass.
In real code (size_t)-2 or (size_t)(-some other value) is at least as likely.
__glibcxx_assert(not in chromium tests) doesn't seem useful.
More information about the Gcc-bugs
mailing list