https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:4d3eaeb4f505b0838c673ee28e7dba8687fc8272

commit r12-2285-g4d3eaeb4f505b0838c673ee28e7dba8687fc8272
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Jul 13 12:21:27 2021 +0100

    libstdc++: Simplify basic_string_view::ends_with [PR 101361]

    The use of npos triggers a diagnostic as described in PR c++/101361.
    This change replaces the use of npos with the exact length, which is
    already known. We can further simplify it by inlining the effects of
    compare and substr, avoiding the redundant range checks in the latter.

    Signed-off-by: Jonathan Wakely <jwak...@redhat.com>

    libstdc++-v3/ChangeLog:

            PR c++/101361
            * include/std/string_view (ends_with): Use traits_type::compare
            directly.

Reply via email to