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

--- Comment #4 from Mital Ashok <mital at mitalashok dot co.uk> ---
(In reply to Andrew Pinski from comment #2)
> Do you have an full example to make sure the match pattern catches this?

<https://godbolt.org/z/Kq5rnoh7n>

    #include <string_view>

    std::string_view rtrim(std::string_view s, char c) {
        auto last = s.find_last_not_of(c);
        return s.substr(0, last == std::string_view::npos ? 0u : last + 1u);
    }

Reply via email to