This should check for c <= 0x7f not x < 0x7f, because 0x7f is an ASCII
character (DEL).
libstdc++-v3/ChangeLog:
* include/bits/unicode.h (__is_single_code_unit): Fix check for
7-bit ASCII characters.
Reviewed-by: Tomasz KamiĆski <tkaminsk@redhat.com>
__is_single_code_unit(char32_t __c)
{
if constexpr (__gnu_cxx::__int_traits<_CharT>::__max <= 0xFF)
- return __c < 0x7F; // ASCII character
+ return __c <= 0x7F; // ASCII character
else
return __c < __gnu_cxx::__int_traits<_CharT>::__max
&& __is_scalar_value(__c);