[PATCH][_GLIBCXX_DEBUG] Review null string assertions (was: Add basic_string::starts_with/ends_with checks)
Jonathan Wakely
jwakely@redhat.com
Wed Aug 31 09:25:39 GMT 2022
On Wed, 31 Aug 2022 at 05:38, François Dumont <frs.dumont@gmail.com> wrote:
>
> If I got your point correctly here is this patch again with just the
> change on '0' becoming 'nullptr' in assertions.
>
> libstdc++: [_GLIBCXX_DEBUG] Review nullptr assertion diagnostics
>
> Review null string checks to show:
> _String != nullptr
>
> rather than:
> _String != 0
>
> libstdc++-v3/ChangeLog:
>
> * include/debug/debug.h: Use nullptr rather than '0' in
> checks in post-C++11.
> * include/debug/string: Likewise.
> *
> testsuite/21_strings/basic_string/operations/ends_with/char.cc: Use
> __gnu_test::string.
> *
> testsuite/21_strings/basic_string/operations/ends_with/nonnull.cc: Likewise.
> *
> testsuite/21_strings/basic_string/operations/ends_with/wchar_t.cc: Likewise.
> *
> testsuite/21_strings/basic_string/operations/starts_with/wchar_t.cc:
> Likewise.
> *
> testsuite/21_strings/basic_string/operations/starts_with/nonnull.cc:
> Likewise.
> *
> testsuite/21_strings/basic_string/operations/starts_with/char.cc: Likewise..
>
> Ok to commit ?
The testsuite changes seem unrelated to the actual code change, so I'd
have done a separate patch. But OK for trunk.
More information about the Libstdc++
mailing list