8sa1-gcc/libstdc++-v3/testsuite
Jakub Jelinek efa64fcce1 libstdc++: Fix up constexpr std::char_traits<char>::compare [PR99181]
Because of LWG 467, std::char_traits<char>::lt compares the values
cast to unsigned char rather than char, so even when char is signed
we get unsigned comparision.  std::char_traits<char>::compare uses
__builtin_memcmp and that works the same, but during constexpr evaluation
we were calling __gnu_cxx::char_traits<char_type>::compare.  As
char_traits::lt is not virtual, __gnu_cxx::char_traits<char_type>::compare
used __gnu_cxx::char_traits<char_type>::lt rather than
std::char_traits<char>::lt and thus compared chars as signed if char is
signed.
This change fixes it by inlining __gnu_cxx::char_traits<char_type>::compare
into std::char_traits<char>::compare by hand, so that it calls the right
lt method.

2021-02-23  Jakub Jelinek  <jakub@redhat.com>

	PR libstdc++/99181
	* include/bits/char_traits.h (char_traits<char>::compare): For
	constexpr evaluation don't call
	__gnu_cxx::char_traits<char_type>::compare but do the comparison loop
	directly.

	* testsuite/21_strings/char_traits/requirements/char/99181.cc: New
	test.
2021-02-23 09:30:18 +01:00
..
17_intro
18_support
19_diagnostics libstdc++: Fix incorrect test for std::error_code comparisons 2021-02-03 15:49:36 +00:00
20_util
21_strings libstdc++: Fix up constexpr std::char_traits<char>::compare [PR99181] 2021-02-23 09:30:18 +01:00
22_locale
23_containers libstdc++: Add unordered containers heterogeneous lookup 2021-02-09 21:56:27 +01:00
24_iterators
25_algorithms
26_numerics
27_io libstdc++: Fix filesystem::rename on Windows [PR 98985] 2021-02-12 15:29:50 +00:00
28_regex
29_atomics
30_threads libstdc++: XFAIL tests that depends on RTTI 2021-02-12 14:30:13 +00:00
abi
backward
config
data
decimal
experimental libstdc++: Fix filesystem::rename on Windows [PR 98985] 2021-02-12 15:29:50 +00:00
ext
lib
libstdc++-abi
libstdc++-dg
libstdc++-prettyprinters
libstdc++-xmethods
performance
special_functions
std
tr1
tr2
util libstdc++: Restore <unistd.h> in testsuite_fs.h header [PR 99096] 2021-02-14 20:38:32 +00:00
Makefile.am libstdc++: Work around test failures using -mno-tree-vrp 2021-02-03 15:49:30 +00:00
Makefile.in libstdc++: Work around test failures using -mno-tree-vrp 2021-02-03 15:49:30 +00:00