libstdc++: Fix std::string_view for I32LP16 targets
authorJonathan Wakely <jwakely@redhat.com>
Mon, 28 Nov 2022 12:16:21 +0000 (12:16 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 28 Nov 2022 16:57:36 +0000 (16:57 +0000)
commita7b97a1f6b9d4993545525fd5cb334ae640ddf45
treecd0c27e74d90c92c6bae08c2ee196c557a52eb61
parent7b79fa930917da735f02b4f6911dfbb0a91f9714
libstdc++: Fix std::string_view for I32LP16 targets

For H8/300 with -msx -mn -mint32 the type of (_M_len - __pos) is int,
because int is wider than size_t so the operands are promoted.

libstdc++-v3/ChangeLog:

* include/std/string_view (basic_string_view::copy) Use explicit
template argument for call to std::min<size_t>.
(basic_string_view::substr): Likewise.
libstdc++-v3/include/std/string_view