libstdc++: Remove unnecessary uses of _GLIBCXX_USE_WCHAR_T in testsuite [PR98725]
Now that std::wstring and other specializations for wchar_t are defined unconditionally, many checks for _GLIBCXX_USE_WCHAR_T in the testsuite are unnecessary and can be removed. Tests for iostreams, locales, regex and filesystem::path still need to be guarded by _GLIBCXX_USE_WCHAR_T because those components depend on libc support in <wchar.h> and other headers. libstdc++-v3/ChangeLog: PR libstdc++/98725 * testsuite/18_support/numeric_limits/lowest.cc: Remove use of _GLIBCXX_USE_WCHAR_T. * testsuite/18_support/numeric_limits/min_max.cc: Replace use of _GLIBCXX_USE_WCHAR_T with checks for WCHAR_MIN and WCHAR_MAX. * testsuite/20_util/from_chars/1_neg.cc: Remove use of _GLIBCXX_USE_WCHAR_T. * testsuite/20_util/function_objects/searchers.cc: Likewise. Use char_traits<wchar_t>::length instead of wcslen. * testsuite/20_util/hash/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_arithmetic/value.cc: Likewise. * testsuite/20_util/is_compound/value.cc: Likewise. * testsuite/20_util/is_floating_point/value.cc: Likewise. * testsuite/20_util/is_fundamental/value.cc: Likewise. * testsuite/20_util/is_integral/value.cc: Likewise. * testsuite/20_util/is_signed/value.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise. * testsuite/20_util/is_void/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs-3.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs-4.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-3.cc: Likewise. * testsuite/20_util/to_chars/3.cc: Likewise. * testsuite/20_util/type_identity/requirements/typedefs.cc: Likewise. * testsuite/21_strings/basic_string/hash/debug.cc: Likewise. * testsuite/21_strings/basic_string/hash/hash.cc: Likewise. * testsuite/21_strings/basic_string/literals/types-char8_t.cc: Likewise. * testsuite/21_strings/basic_string/literals/types.cc: Likewise. * testsuite/21_strings/basic_string/literals/values-char8_t.cc: Likewise. * testsuite/21_strings/basic_string/literals/values.cc: Likewise. * testsuite/21_strings/basic_string/modifiers/64422.cc: Likewise. * testsuite/21_strings/basic_string/range_access/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string/requirements/citerators.cc: Likewise. * testsuite/21_strings/basic_string/requirements/typedefs.cc: Likewise. * testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Likewise. * testsuite/21_strings/basic_string_view/literals/types-char8_t.cc: Likewise. * testsuite/21_strings/basic_string_view/literals/types.cc: Likewise. * testsuite/21_strings/basic_string_view/literals/values-char8_t.cc: Likewise. * testsuite/21_strings/basic_string_view/literals/values.cc: Likewise. * testsuite/21_strings/basic_string_view/requirements/typedefs.cc: Likewise. * testsuite/21_strings/basic_string_view/typedefs.cc: Likewise. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: Likewise. * testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc: Likewise. * testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc: Likewise. * testsuite/22_locale/ctype/is/string/89728_neg.cc: Likewise. * testsuite/25_algorithms/fill/4.cc: Likewise. * testsuite/25_algorithms/fill_n/1.cc: Likewise. * testsuite/experimental/functional/searchers.cc: Likewise. Use char_traits<wchar_t>::length instead of wcslen. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc: Likewise. * testsuite/experimental/string_view/literals/types-char8_t.cc: Likewise. * testsuite/experimental/string_view/literals/types.cc: Likewise. * testsuite/experimental/string_view/literals/values-char8_t.cc: Likewise. * testsuite/experimental/string_view/literals/values.cc: Likewise. * testsuite/experimental/string_view/range_access/wchar_t/1.cc: Likewise. * testsuite/experimental/string_view/requirements/typedefs.cc: Likewise. * testsuite/experimental/string_view/typedefs.cc: Likewise. * testsuite/ext/vstring/range_access.cc: Likewise. * testsuite/std/concepts/concepts.lang/concept.arithmetic/integral.cc: Likewise. * testsuite/std/concepts/concepts.lang/concept.arithmetic/signed_integral.cc: Likewise. * testsuite/std/concepts/concepts.lang/concept.arithmetic/unsigned_integral.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_compound/value.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_floating_point/value.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_fundamental/value.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_integral/value.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_signed/value.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_unsigned/value.cc: Likewise. * testsuite/tr1/4_metaprogramming/is_void/value.cc: Likewise. * testsuite/tr1/6_containers/hash/24799.cc: Likewise.
This commit is contained in:
parent
9a89281c40
commit
fec283b63d
|
@ -52,9 +52,7 @@ void test01()
|
|||
do_test<char>();
|
||||
do_test<signed char>();
|
||||
do_test<unsigned char>();
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
do_test<wchar_t>();
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
do_test<char8_t>();
|
||||
#endif
|
||||
|
|
|
@ -48,9 +48,9 @@ DEFINE_EXTREMA(unsigned, 0U, UINT_MAX);
|
|||
DEFINE_EXTREMA(long, LONG_MIN, LONG_MAX);
|
||||
DEFINE_EXTREMA(unsigned long, 0UL, ULONG_MAX);
|
||||
|
||||
#if _GLIBCXX_USE_WCHAR_T
|
||||
#if defined WCHAR_MIN && defined WCHAR_MAX
|
||||
DEFINE_EXTREMA(wchar_t, WCHAR_MIN, WCHAR_MAX);
|
||||
#endif //_GLIBCXX_USE_WCHAR_T
|
||||
#endif
|
||||
|
||||
DEFINE_EXTREMA(float, FLT_MIN, FLT_MAX);
|
||||
DEFINE_EXTREMA(double, DBL_MIN, DBL_MAX);
|
||||
|
@ -74,7 +74,7 @@ int main()
|
|||
test_extrema<char>();
|
||||
test_extrema<signed char>();
|
||||
test_extrema<unsigned char>();
|
||||
|
||||
|
||||
test_extrema<short>();
|
||||
test_extrema<unsigned short>();
|
||||
|
||||
|
|
|
@ -22,11 +22,7 @@
|
|||
void
|
||||
test01(const char* first, const char* last)
|
||||
{
|
||||
#if _GLIBCXX_USE_WCHAR_T
|
||||
wchar_t wc;
|
||||
#else
|
||||
enum W { } wc;
|
||||
#endif
|
||||
std::from_chars(first, last, wc); // { dg-error "no matching" }
|
||||
std::from_chars(first, last, wc, 10); // { dg-error "no matching" }
|
||||
|
||||
|
|
|
@ -18,11 +18,9 @@
|
|||
// { dg-do run { target c++17 } }
|
||||
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
#include <cstring>
|
||||
#include <cctype>
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
# include <cwchar>
|
||||
#endif
|
||||
#include <algorithm>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
|
@ -84,7 +82,6 @@ test01()
|
|||
void
|
||||
test02()
|
||||
{
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
const wchar_t s[] = { L'a', (wchar_t)-97, L'a', L'\0' };
|
||||
const wchar_t* needles[] = {
|
||||
s, L"", L"a", L"aa", L"aaa", L"ab", L"cd", L"abcd", L"abcdabcd", L"abcabcd"
|
||||
|
@ -96,14 +93,14 @@ test02()
|
|||
|
||||
for (auto n : needles)
|
||||
{
|
||||
auto nlen = std::wcslen(n);
|
||||
auto nlen = std::char_traits<wchar_t>::length(n);
|
||||
auto ne = n + nlen;
|
||||
default_searcher d(n, ne);
|
||||
boyer_moore_searcher bm(n, ne);
|
||||
boyer_moore_horspool_searcher bmh(n, ne);
|
||||
for (auto h : haystacks)
|
||||
{
|
||||
auto he = h + std::wcslen(h);
|
||||
auto he = h + std::char_traits<wchar_t>::length(h);
|
||||
auto res = std::search(h, he, n, ne);
|
||||
auto d_res = d(h, he);
|
||||
VERIFY( d_res.first == res );
|
||||
|
@ -125,7 +122,6 @@ test02()
|
|||
VERIFY( bmh_res.second == (bmh_res.first + nlen) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -47,8 +47,5 @@ template class std::hash<std::error_code>;
|
|||
template class std::hash<std::error_condition>;
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
template class std::hash<wchar_t>;
|
||||
template class std::hash<std::wstring>;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,9 +30,7 @@ void test01()
|
|||
static_assert(test_category<is_arithmetic, char>(true), "");
|
||||
static_assert(test_category<is_arithmetic, signed char>(true), "");
|
||||
static_assert(test_category<is_arithmetic, unsigned char>(true), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_arithmetic, wchar_t>(true), "");
|
||||
#endif
|
||||
static_assert(test_category<is_arithmetic, short>(true), "");
|
||||
static_assert(test_category<is_arithmetic, unsigned short>(true), "");
|
||||
static_assert(test_category<is_arithmetic, int>(true), "");
|
||||
|
|
|
@ -29,9 +29,7 @@ void test01()
|
|||
static_assert(test_category<is_compound, char>(false), "");
|
||||
static_assert(test_category<is_compound, signed char>(false), "");
|
||||
static_assert(test_category<is_compound, unsigned char>(false), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_compound, wchar_t>(false), "");
|
||||
#endif
|
||||
static_assert(test_category<is_compound, short>(false), "");
|
||||
static_assert(test_category<is_compound, unsigned short>(false), "");
|
||||
static_assert(test_category<is_compound, int>(false), "");
|
||||
|
|
|
@ -30,9 +30,7 @@ void test01()
|
|||
static_assert(test_category<is_floating_point, char>(false), "");
|
||||
static_assert(test_category<is_floating_point, signed char>(false), "");
|
||||
static_assert(test_category<is_floating_point, unsigned char>(false), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_floating_point, wchar_t>(false), "");
|
||||
#endif
|
||||
static_assert(test_category<is_floating_point, short>(false), "");
|
||||
static_assert(test_category<is_floating_point, unsigned short>(false), "");
|
||||
static_assert(test_category<is_floating_point, int>(false), "");
|
||||
|
|
|
@ -24,14 +24,12 @@ void test01()
|
|||
{
|
||||
using std::is_fundamental;
|
||||
using namespace __gnu_test;
|
||||
|
||||
|
||||
static_assert(test_category<is_fundamental, void>(true), "");
|
||||
static_assert(test_category<is_fundamental, char>(true), "");
|
||||
static_assert(test_category<is_fundamental, signed char>(true), "");
|
||||
static_assert(test_category<is_fundamental, unsigned char>(true), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_fundamental, wchar_t>(true), "");
|
||||
#endif
|
||||
static_assert(test_category<is_fundamental, short>(true), "");
|
||||
static_assert(test_category<is_fundamental, unsigned short>(true), "");
|
||||
static_assert(test_category<is_fundamental, int>(true), "");
|
||||
|
|
|
@ -28,13 +28,11 @@ void test01()
|
|||
using namespace __gnu_test;
|
||||
|
||||
static_assert(test_category<is_integral, void>(false), "");
|
||||
|
||||
|
||||
static_assert(test_category<is_integral, char>(true), "");
|
||||
static_assert(test_category<is_integral, signed char>(true), "");
|
||||
static_assert(test_category<is_integral, unsigned char>(true), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_integral, wchar_t>(true), "");
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
static_assert(test_category<is_integral, char8_t>(true), "");
|
||||
#endif
|
||||
|
|
|
@ -26,16 +26,14 @@ void test01()
|
|||
{
|
||||
using std::is_signed;
|
||||
using namespace __gnu_test;
|
||||
|
||||
|
||||
static_assert(test_category<is_signed, void>(false), "");
|
||||
|
||||
|
||||
static_assert(test_category<is_signed, char>(char(-1) < char(0)), "");
|
||||
static_assert(test_category<is_signed, signed char>(true), "");
|
||||
static_assert(test_category<is_signed, unsigned char>(false), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_signed, wchar_t>
|
||||
(wchar_t(-1) < wchar_t(0)), "");
|
||||
#endif
|
||||
static_assert(test_category<is_signed, short>(true), "");
|
||||
static_assert(test_category<is_signed, unsigned short>(false), "");
|
||||
static_assert(test_category<is_signed, int>(true), "");
|
||||
|
|
|
@ -28,14 +28,12 @@ void test01()
|
|||
using namespace __gnu_test;
|
||||
|
||||
static_assert(test_category<is_unsigned, void>(false), "");
|
||||
|
||||
|
||||
static_assert(test_category<is_unsigned, char>(char(-1) > char(0)), "");
|
||||
static_assert(test_category<is_unsigned, signed char>(false), "");
|
||||
static_assert(test_category<is_unsigned, unsigned char>(true), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_unsigned, wchar_t>
|
||||
(wchar_t(-1) > wchar_t(0)), "");
|
||||
#endif
|
||||
static_assert(test_category<is_unsigned, short>(false), "");
|
||||
static_assert(test_category<is_unsigned, unsigned short>(true), "");
|
||||
static_assert(test_category<is_unsigned, int>(false), "");
|
||||
|
|
|
@ -26,13 +26,11 @@ void test01()
|
|||
using namespace __gnu_test;
|
||||
|
||||
static_assert(test_category<is_void, void>(true), "");
|
||||
|
||||
|
||||
static_assert(test_category<is_void, char>(false), "");
|
||||
static_assert(test_category<is_void, signed char>(false), "");
|
||||
static_assert(test_category<is_void, unsigned char>(false), "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test_category<is_void, wchar_t>(false), "");
|
||||
#endif
|
||||
static_assert(test_category<is_void, short>(false), "");
|
||||
static_assert(test_category<is_void, unsigned short>(false), "");
|
||||
static_assert(test_category<is_void, int>(false), "");
|
||||
|
|
|
@ -51,13 +51,11 @@ void test01()
|
|||
static_assert( is_same<test22_type, const signed char>::value,
|
||||
"make_signed<const char>" );
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
typedef make_signed<volatile wchar_t>::type test23_type;
|
||||
static_assert( is_signed<test23_type>::value
|
||||
&& is_volatile<test23_type>::value
|
||||
&& sizeof(test23_type) == sizeof(volatile wchar_t),
|
||||
"make_signed<volatile wchar_t>" );
|
||||
#endif
|
||||
|
||||
// Chapter 48, chapter 20. Smallest rank such that new signed type same size.
|
||||
typedef make_signed<test_enum>::type test24_type;
|
||||
|
|
|
@ -49,12 +49,10 @@ void test01()
|
|||
typedef make_signed<const char>::type test22_type;
|
||||
static_assert(is_same<test22_type, const signed char>::value, "");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
typedef make_signed<volatile wchar_t>::type test23_type;
|
||||
static_assert(is_signed<test23_type>::value
|
||||
&& is_volatile<test23_type>::value
|
||||
&& sizeof(test23_type) == sizeof(volatile wchar_t), "");
|
||||
#endif
|
||||
|
||||
typedef make_signed<test_enum>::type test24_type;
|
||||
static_assert(is_same<test24_type, short>::value, "");
|
||||
|
|
|
@ -72,8 +72,6 @@ static_assert(is_same<make_signed<char16_t const>::type, I6 const>::value, "");
|
|||
using I7 = smallest_rank_t<char32_t>;
|
||||
static_assert(is_same<make_signed<char32_t>::type, I7>::value, "");
|
||||
static_assert(is_same<make_signed<char32_t const>::type, I7 const>::value, "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
using I8 = smallest_rank_t<wchar_t>;
|
||||
static_assert(is_same<make_signed<wchar_t>::type, I8>::value, "");
|
||||
static_assert(is_same<make_signed<wchar_t const>::type, I8 const>::value, "");
|
||||
#endif
|
||||
|
|
|
@ -22,11 +22,9 @@
|
|||
// libstdc++/60326
|
||||
|
||||
using namespace std;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
using wchar_signed = make_signed<wchar_t>::type;
|
||||
using wchar_unsigned = make_unsigned<wchar_t>::type;
|
||||
static_assert( !is_same<wchar_signed, wchar_unsigned>::value, "wchar_t" );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
static_assert( is_signed<make_signed<char8_t>::type>::value, "char8_t");
|
||||
#endif
|
||||
|
|
|
@ -47,12 +47,10 @@ void test01()
|
|||
typedef make_unsigned<const char>::type test22_type;
|
||||
static_assert(is_same<test22_type, const unsigned char>::value, "");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
typedef make_unsigned<volatile wchar_t>::type test23_type;
|
||||
static_assert(is_unsigned<test23_type>::value
|
||||
&& is_volatile<test23_type>::value
|
||||
&& sizeof(test23_type) == sizeof(volatile wchar_t), "");
|
||||
#endif
|
||||
|
||||
// Chapter 48, chapter 20. Smallest rank such that new unsigned type
|
||||
// same size.
|
||||
|
|
|
@ -49,12 +49,10 @@ void test01()
|
|||
typedef make_unsigned<const char>::type test22_type;
|
||||
static_assert(is_same<test22_type, const unsigned char>::value, "");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
typedef make_unsigned<volatile wchar_t>::type test23_type;
|
||||
static_assert(is_unsigned<test23_type>::value
|
||||
&& is_volatile<test23_type>::value
|
||||
&& sizeof(test23_type) == sizeof(volatile wchar_t), "");
|
||||
#endif
|
||||
|
||||
typedef make_unsigned<test_enum>::type test24_type;
|
||||
static_assert(is_same<test24_type, unsigned short>::value, "");
|
||||
|
|
|
@ -72,8 +72,6 @@ static_assert(is_same<make_unsigned<char16_t const>::type, I6 const>::value, "")
|
|||
using I7 = smallest_rank_t<char32_t>;
|
||||
static_assert(is_same<make_unsigned<char32_t>::type, I7>::value, "");
|
||||
static_assert(is_same<make_unsigned<char32_t const>::type, I7 const>::value, "");
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
using I8 = smallest_rank_t<wchar_t>;
|
||||
static_assert(is_same<make_unsigned<wchar_t>::type, I8>::value, "");
|
||||
static_assert(is_same<make_unsigned<wchar_t const>::type, I8 const>::value, "");
|
||||
#endif
|
||||
|
|
|
@ -48,9 +48,7 @@ test01()
|
|||
{
|
||||
VERIFY( check_to_chars(u'\x21') );
|
||||
VERIFY( check_to_chars(U'\x21') );
|
||||
#if _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( check_to_chars(L'\x21') );
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
|
|
|
@ -38,10 +38,7 @@ void test01()
|
|||
static_assert(test<volatile unsigned int>::value, "");
|
||||
static_assert(test<const volatile unsigned int>::value, "");
|
||||
static_assert(test<const unsigned char>::value, "");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(test<volatile wchar_t>::value, "" );
|
||||
#endif
|
||||
|
||||
// Pointers
|
||||
static_assert(test<void*>::value, "");
|
||||
|
|
|
@ -43,9 +43,7 @@ test01()
|
|||
#endif
|
||||
VERIFY( test(__gnu_debug::u16string(u"a utf-16 string")) );
|
||||
VERIFY( test(__gnu_debug::u32string(U"a utf-32 string")) );
|
||||
#if _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( test(__gnu_debug::wstring(L"a wide string")) );
|
||||
#endif
|
||||
}
|
||||
|
||||
#if _GLIBCXX_USE_CHAR8_T
|
||||
|
|
|
@ -40,9 +40,7 @@ test01()
|
|||
VERIFY( test(std::string("a narrow string")) );
|
||||
VERIFY( test(std::u16string(u"a utf-16 string")) );
|
||||
VERIFY( test(std::u32string(U"a utf-32 string")) );
|
||||
#if _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( test(std::wstring(L"a wide string")) );
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -52,10 +50,8 @@ test02()
|
|||
VERIFY( test(std::pmr::string("a narrow string, but with PMR!")) );
|
||||
VERIFY( test(std::pmr::u16string(u"a utf-16 string, but with PMR!")) );
|
||||
VERIFY( test(std::pmr::u32string(U"a utf-32 string, but with PMR!")) );
|
||||
#if _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( test(std::pmr::wstring(L"a wide string, but with PMR!")) );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -38,10 +38,8 @@ test01()
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same<decltype(L"Hello"s), std::wstring>::value,
|
||||
"L\"Hello\"s is std::wstring");
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<decltype(u"Hello"s), std::u16string>::value,
|
||||
"u\"Hello\"s is std::u16string");
|
||||
|
|
|
@ -37,10 +37,8 @@ test01()
|
|||
static_assert(std::is_same<decltype(u8"Hello"s), u8string>::value,
|
||||
"u8\"Hello\"s is std::string");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same<decltype(L"Hello"s), std::wstring>::value,
|
||||
"L\"Hello\"s is std::wstring");
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<decltype(u"Hello"s), std::u16string>::value,
|
||||
"u\"Hello\"s is std::u16string");
|
||||
|
|
|
@ -27,9 +27,7 @@ test01()
|
|||
using namespace std::literals::string_literals;
|
||||
|
||||
std::string planet = "Mercury"s;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring wplanet = L"Venus"s;
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
std::u8string u8planet = u8"Mars"s;
|
||||
#else
|
||||
|
@ -39,9 +37,7 @@ test01()
|
|||
std::u32string u32planet = U"Saturn"s;
|
||||
|
||||
VERIFY( planet == std::string("Mercury") );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet == std::wstring(L"Venus") );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
VERIFY( u8planet == std::u8string(u8"Mars") );
|
||||
#else
|
||||
|
|
|
@ -32,17 +32,13 @@ test01()
|
|||
using namespace std::literals::string_literals;
|
||||
|
||||
std::string planet = "Mercury"s;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring wplanet = L"Venus"s;
|
||||
#endif
|
||||
u8string u8planet = u8"Mars"s;
|
||||
std::u16string u16planet = u"Jupiter"s;
|
||||
std::u32string u32planet = U"Saturn"s;
|
||||
|
||||
VERIFY( planet == std::string("Mercury") );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet == std::wstring(L"Venus") );
|
||||
#endif
|
||||
VERIFY( u8planet == u8string(u8"Mars") );
|
||||
VERIFY( u16planet == std::u16string(u"Jupiter") );
|
||||
VERIFY( u32planet == std::u32string(U"Saturn") );
|
||||
|
|
|
@ -34,7 +34,6 @@ main ()
|
|||
x.replace (x.begin (), x.end (), best, best + 4);
|
||||
x.replace (x.begin (), x.end (), x);
|
||||
x.erase (x.begin (), x.end ());
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring w;
|
||||
w.insert (w.begin (), 10, L'x');
|
||||
const wchar_t west[] = L"west";
|
||||
|
@ -44,6 +43,5 @@ main ()
|
|||
w.replace (w.begin (), w.end (), rest, rest + 4);
|
||||
w.replace (w.begin (), w.end (), w);
|
||||
w.erase (w.begin (), w.end ());
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
void
|
||||
test01()
|
||||
{
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring ws(L"Hello, World!");
|
||||
(void) std::begin(ws);
|
||||
(void) std::end(ws);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -27,9 +27,7 @@ int main()
|
|||
{
|
||||
__gnu_test::citerator<std::string> test1;
|
||||
__gnu_test::citerator<__gnu_debug::string> dtest1;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
__gnu_test::citerator<std::wstring> test2;
|
||||
__gnu_test::citerator<__gnu_debug::wstring> dtest2;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,5 @@
|
|||
// Check container for required typedefs.
|
||||
__gnu_test::types<std::string> t1;
|
||||
__gnu_test::types<__gnu_debug::string> dt1;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
__gnu_test::types<std::wstring> t2;
|
||||
__gnu_test::types<__gnu_debug::wstring> dt2;
|
||||
#endif
|
||||
|
|
|
@ -44,7 +44,6 @@ static_assert(std::is_same_v<std::pmr::u32string,
|
|||
std::basic_string<char32_t, std::char_traits<char32_t>,
|
||||
std::pmr::polymorphic_allocator<char32_t>>>);
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same_v<std::pmr::basic_string<wchar_t>,
|
||||
std::basic_string<wchar_t, std::char_traits<wchar_t>,
|
||||
std::pmr::polymorphic_allocator<wchar_t>>>);
|
||||
|
@ -54,4 +53,3 @@ static_assert(std::is_same_v<std::pmr::basic_string<wchar_t, T>,
|
|||
static_assert(std::is_same_v<std::pmr::wstring,
|
||||
std::basic_string<wchar_t, std::char_traits<wchar_t>,
|
||||
std::pmr::polymorphic_allocator<wchar_t>>>);
|
||||
#endif
|
||||
|
|
|
@ -37,10 +37,8 @@ test01()
|
|||
"u8\"Hello\"sv is std::string_view");
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same<decltype(L"Hello"sv), std::wstring_view>::value,
|
||||
"L\"Hello\"sv is std::wstring_view");
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<decltype(u"Hello"sv), std::u16string_view>::value,
|
||||
"u\"Hello\"sv is std::u16string_view");
|
||||
|
|
|
@ -37,10 +37,8 @@ test01()
|
|||
static_assert(std::is_same<decltype(u8"Hello"sv), u8string_view>::value,
|
||||
"u8\"Hello\"s is std::string_view");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same<decltype(L"Hello"sv), std::wstring_view>::value,
|
||||
"L\"Hello\"s is std::wstring_view");
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<decltype(u"Hello"sv), std::u16string_view>::value,
|
||||
"u\"Hello\"s is std::u16string_view");
|
||||
|
|
|
@ -27,9 +27,7 @@ test01()
|
|||
using namespace std::literals::string_view_literals;
|
||||
|
||||
std::string_view planet = "Mercury"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring_view wplanet = L"Venus"sv;
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
std::u8string_view u8planet = u8"Mars"sv;
|
||||
#else
|
||||
|
@ -39,9 +37,7 @@ test01()
|
|||
std::u32string_view u32planet = U"Saturn"sv;
|
||||
|
||||
VERIFY( planet == std::string_view("Mercury") );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet == std::wstring_view(L"Venus") );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
VERIFY( u8planet == std::u8string_view(u8"Mars") );
|
||||
#else
|
||||
|
@ -57,9 +53,7 @@ test02()
|
|||
using namespace std::literals::string_view_literals;
|
||||
|
||||
std::string_view planet_cratered = "Mercury\0cratered"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring_view wplanet_cratered = L"Venus\0cratered"sv;
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
std::u8string_view u8planet_cratered = u8"Mars\0cratered"sv;
|
||||
#else
|
||||
|
@ -69,9 +63,7 @@ test02()
|
|||
std::u32string_view u32planet_cratered = U"Saturn\0cratered"sv;
|
||||
|
||||
VERIFY( planet_cratered == std::string_view("Mercury\0cratered", 16) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet_cratered == std::wstring_view(L"Venus\0cratered", 14) );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
VERIFY( u8planet_cratered == std::u8string_view(u8"Mars\0cratered", 13) );
|
||||
#else
|
||||
|
|
|
@ -32,17 +32,13 @@ test01()
|
|||
using namespace std::literals::string_view_literals;
|
||||
|
||||
std::string_view planet = "Mercury"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring_view wplanet = L"Venus"sv;
|
||||
#endif
|
||||
u8string_view u8planet = u8"Mars"sv;
|
||||
std::u16string_view u16planet = u"Jupiter"sv;
|
||||
std::u32string_view u32planet = U"Saturn"sv;
|
||||
|
||||
VERIFY( planet == std::string_view("Mercury") );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet == std::wstring_view(L"Venus") );
|
||||
#endif
|
||||
VERIFY( u8planet == u8string_view(u8"Mars") );
|
||||
VERIFY( u16planet == std::u16string_view(u"Jupiter") );
|
||||
VERIFY( u32planet == std::u32string_view(U"Saturn") );
|
||||
|
@ -54,17 +50,13 @@ test02()
|
|||
using namespace std::literals::string_view_literals;
|
||||
|
||||
std::string_view planet_cratered = "Mercury\0cratered"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::wstring_view wplanet_cratered = L"Venus\0cratered"sv;
|
||||
#endif
|
||||
u8string_view u8planet_cratered = u8"Mars\0cratered"sv;
|
||||
std::u16string_view u16planet_cratered = u"Jupiter\0cratered"sv;
|
||||
std::u32string_view u32planet_cratered = U"Saturn\0cratered"sv;
|
||||
|
||||
VERIFY( planet_cratered == std::string_view("Mercury\0cratered", 16) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet_cratered == std::wstring_view(L"Venus\0cratered", 14) );
|
||||
#endif
|
||||
VERIFY( u8planet_cratered == u8string_view(u8"Mars\0cratered", 13) );
|
||||
VERIFY( u16planet_cratered == std::u16string_view(u"Jupiter\0cratered", 16) );
|
||||
VERIFY( u32planet_cratered == std::u32string_view(U"Saturn\0cratered", 15) );
|
||||
|
|
|
@ -39,11 +39,9 @@ __gnu_test::basic_types<std::string_view> t1b;
|
|||
__gnu_test::reversible_types<std::string_view> t1r;
|
||||
typedef typename std::string_view::traits_type traits_type1;
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
__gnu_test::basic_types<std::wstring_view> t2b;
|
||||
__gnu_test::reversible_types<std::wstring_view> t2r;
|
||||
typedef typename std::wstring_view::traits_type traits_type2;
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<std::string_view::pointer, char*>(),
|
||||
"pointer should be value_type*");
|
||||
|
|
|
@ -33,6 +33,4 @@ using check4_t = std::u16string_view;
|
|||
using check5_t = std::u32string_view;
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
using check6_t = std::wstring_view;
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace __gnu_test
|
|||
struct _Concept
|
||||
{
|
||||
void __constraint()
|
||||
{
|
||||
{
|
||||
typedef typename _Ttesttype::char_type char_type;
|
||||
typedef typename _Ttesttype::int_type int_type;
|
||||
const char_type c1(0);
|
||||
|
@ -64,9 +64,7 @@ int main()
|
|||
{
|
||||
__gnu_test::constexpr_member_functions test;
|
||||
test.operator()<std::char_traits<char>>();
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
test.operator()<std::char_traits<wchar_t>>();
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
test.operator()<std::char_traits<char8_t>>();
|
||||
#endif
|
||||
|
|
|
@ -89,12 +89,10 @@ static_assert( test_assign<std::char_traits<char>>() );
|
|||
static_assert( test_compare<std::char_traits<char>>() );
|
||||
static_assert( test_length<std::char_traits<char>>() );
|
||||
static_assert( test_find<std::char_traits<char>>() );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert( test_assign<std::char_traits<wchar_t>>() );
|
||||
static_assert( test_compare<std::char_traits<wchar_t>>() );
|
||||
static_assert( test_length<std::char_traits<wchar_t>>() );
|
||||
static_assert( test_find<std::char_traits<wchar_t>>() );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
static_assert( test_assign<std::char_traits<char8_t>>() );
|
||||
static_assert( test_compare<std::char_traits<char8_t>>() );
|
||||
|
|
|
@ -44,9 +44,7 @@ template<typename CT>
|
|||
#endif
|
||||
|
||||
static_assert( test_move<std::char_traits<char>>() );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert( test_move<std::char_traits<wchar_t>>() );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
static_assert( test_move<std::char_traits<char8_t>>() );
|
||||
#endif
|
||||
|
|
|
@ -52,7 +52,6 @@ void test01()
|
|||
std::tolower(make_str<char, 12>(), loc); // { dg-error "required from here" }
|
||||
}
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
void test02()
|
||||
{
|
||||
const std::locale& loc = std::locale::classic();
|
||||
|
@ -74,4 +73,3 @@ void test02()
|
|||
std::toupper(make_str<wchar_t, 11>(), loc); // { dg-error "required from here" }
|
||||
std::tolower(make_str<wchar_t, 12>(), loc); // { dg-error "required from here" }
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,7 @@ test01()
|
|||
|
||||
const int A1[] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
|
||||
const int N1 = sizeof(A1) / sizeof(int);
|
||||
|
||||
|
||||
int i1[N1];
|
||||
fill(i1, i1 + N1, 3);
|
||||
VERIFY( equal(i1, i1 + N1, A1) );
|
||||
|
@ -51,7 +51,6 @@ test01()
|
|||
fill(v2.begin(), v2.end(), '\3');
|
||||
VERIFY( equal(v2.begin(), v2.end(), A2) );
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
const wchar_t A3[] = {L'\3', L'\3', L'\3', L'\3', L'\3',
|
||||
L'\3', L'\3', L'\3', L'\3', L'\3'};
|
||||
const int N3 = sizeof(A3) / sizeof(wchar_t);
|
||||
|
@ -63,7 +62,6 @@ test01()
|
|||
vector<wchar_t> v3(N3);
|
||||
fill(v3.begin(), v3.end(), L'\3');
|
||||
VERIFY( equal(v3.begin(), v3.end(), A3) );
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -44,7 +44,7 @@ test01()
|
|||
|
||||
const int A1[] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
|
||||
const int N1 = sizeof(A1) / sizeof(int);
|
||||
|
||||
|
||||
int i1[N1];
|
||||
test_container<int, output_iterator_wrapper> c1(i1, i1 + N1);
|
||||
fill_n(c1.begin(), N1, 3);
|
||||
|
@ -66,7 +66,6 @@ test01()
|
|||
fill_n(v2.begin(), N2, '\3');
|
||||
VERIFY( equal(v2.begin(), v2.end(), A2) );
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
const wchar_t A3[] = {L'\3', L'\3', L'\3', L'\3', L'\3',
|
||||
L'\3', L'\3', L'\3', L'\3', L'\3'};
|
||||
const int N3 = sizeof(A3) / sizeof(wchar_t);
|
||||
|
@ -78,7 +77,6 @@ test01()
|
|||
vector<wchar_t> v3(N3);
|
||||
fill_n(v3.begin(), N3, L'\3');
|
||||
VERIFY( equal(v3.begin(), v3.end(), A3) );
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
// { dg-do run { target c++14 } }
|
||||
|
||||
#include <experimental/functional>
|
||||
#include <experimental/string_view>
|
||||
#include <cstring>
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
# include <cwchar>
|
||||
#endif
|
||||
#include <algorithm>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
|
@ -64,7 +62,6 @@ test01()
|
|||
void
|
||||
test02()
|
||||
{
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
const wchar_t s[] = { L'a', (wchar_t)-97, L'a', L'\0' };
|
||||
const wchar_t* needles[] = {
|
||||
s, L"", L"a", L"aa", L"aaa", L"ab", L"cd", L"abcd", L"abcdabcd", L"abcabcd"
|
||||
|
@ -76,13 +73,13 @@ test02()
|
|||
|
||||
for (auto n : needles)
|
||||
{
|
||||
auto ne = n + std::wcslen(n);
|
||||
auto ne = n + std::char_traits<wchar_t>::length(n);
|
||||
auto d = make_default_searcher(n, ne);
|
||||
auto bm = make_boyer_moore_searcher(n, ne);
|
||||
auto bmh = make_boyer_moore_horspool_searcher(n, ne);
|
||||
for (auto h : haystacks)
|
||||
{
|
||||
auto he = h + std::wcslen(h);
|
||||
auto he = h + std::char_traits<wchar_t>::length(h);
|
||||
auto res = std::search(h, he, n, ne);
|
||||
auto d_res = d(h, he);
|
||||
VERIFY( d_res == res );
|
||||
|
@ -92,7 +89,6 @@ test02()
|
|||
VERIFY( bmh_res == res );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -51,7 +51,6 @@ static_assert(std::is_same<xpmr::u32string,
|
|||
xpmr::polymorphic_allocator<char32_t>>>::value,
|
||||
"pmr::u32string");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same<xpmr::basic_string<wchar_t>,
|
||||
std::basic_string<wchar_t, std::char_traits<wchar_t>,
|
||||
xpmr::polymorphic_allocator<wchar_t>>>::value,
|
||||
|
@ -64,4 +63,3 @@ static_assert(std::is_same<xpmr::wstring,
|
|||
std::basic_string<wchar_t, std::char_traits<wchar_t>,
|
||||
xpmr::polymorphic_allocator<wchar_t>>>::value,
|
||||
"pmr::wstring");
|
||||
#endif
|
||||
|
|
|
@ -37,10 +37,8 @@ test01()
|
|||
"u8\"Hello\"sv is std::string_view");
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same<decltype(L"Hello"sv), std::experimental::wstring_view>::value,
|
||||
"L\"Hello\"sv is std::wstring_view");
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<decltype(u"Hello"sv), std::experimental::u16string_view>::value,
|
||||
"u\"Hello\"sv is std::u16string_view");
|
||||
|
|
|
@ -37,10 +37,8 @@ test01()
|
|||
static_assert(std::is_same<decltype(u8"Hello"sv), u8string_view>::value,
|
||||
"u8\"Hello\"s is std::string_view");
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert(std::is_same<decltype(L"Hello"sv), std::experimental::wstring_view>::value,
|
||||
"L\"Hello\"s is std::wstring_view");
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<decltype(u"Hello"sv), std::experimental::u16string_view>::value,
|
||||
"u\"Hello\"s is std::u16string_view");
|
||||
|
|
|
@ -27,9 +27,7 @@ test01()
|
|||
using namespace std::experimental::literals::string_view_literals;
|
||||
|
||||
std::experimental::string_view planet = "Mercury"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::experimental::wstring_view wplanet = L"Venus"sv;
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
std::experimental::u8string_view u8planet = u8"Mars"sv;
|
||||
#else
|
||||
|
@ -39,9 +37,7 @@ test01()
|
|||
std::experimental::u32string_view u32planet = U"Saturn"sv;
|
||||
|
||||
VERIFY( planet == std::experimental::string_view("Mercury") );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet == std::experimental::wstring_view(L"Venus") );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
VERIFY( u8planet == std::experimental::u8string_view(u8"Mars") );
|
||||
#else
|
||||
|
@ -57,9 +53,7 @@ test02()
|
|||
using namespace std::experimental::literals::string_view_literals;
|
||||
|
||||
std::experimental::string_view planet_cratered = "Mercury\0cratered"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::experimental::wstring_view wplanet_cratered = L"Venus\0cratered"sv;
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
std::experimental::u8string_view u8planet_cratered = u8"Mars\0cratered"sv;
|
||||
#else
|
||||
|
@ -70,10 +64,8 @@ test02()
|
|||
|
||||
VERIFY( planet_cratered ==
|
||||
std::experimental::string_view("Mercury\0cratered", 16) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet_cratered ==
|
||||
std::experimental::wstring_view(L"Venus\0cratered", 14) );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
VERIFY( u8planet_cratered ==
|
||||
std::experimental::u8string_view(u8"Mars\0cratered", 13) );
|
||||
|
|
|
@ -32,17 +32,13 @@ test01()
|
|||
using namespace std::experimental::literals::string_view_literals;
|
||||
|
||||
std::experimental::string_view planet = "Mercury"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::experimental::wstring_view wplanet = L"Venus"sv;
|
||||
#endif
|
||||
u8string_view u8planet = u8"Mars"sv;
|
||||
std::experimental::u16string_view u16planet = u"Jupiter"sv;
|
||||
std::experimental::u32string_view u32planet = U"Saturn"sv;
|
||||
|
||||
VERIFY( planet == std::experimental::string_view("Mercury") );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet == std::experimental::wstring_view(L"Venus") );
|
||||
#endif
|
||||
VERIFY( u8planet == u8string_view(u8"Mars") );
|
||||
VERIFY( u16planet == std::experimental::u16string_view(u"Jupiter") );
|
||||
VERIFY( u32planet == std::experimental::u32string_view(U"Saturn") );
|
||||
|
@ -54,19 +50,15 @@ test02()
|
|||
using namespace std::experimental::literals::string_view_literals;
|
||||
|
||||
std::experimental::string_view planet_cratered = "Mercury\0cratered"sv;
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::experimental::wstring_view wplanet_cratered = L"Venus\0cratered"sv;
|
||||
#endif
|
||||
u8string_view u8planet_cratered = u8"Mars\0cratered"sv;
|
||||
std::experimental::u16string_view u16planet_cratered = u"Jupiter\0cratered"sv;
|
||||
std::experimental::u32string_view u32planet_cratered = U"Saturn\0cratered"sv;
|
||||
|
||||
VERIFY( planet_cratered ==
|
||||
std::experimental::string_view("Mercury\0cratered", 16) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( wplanet_cratered ==
|
||||
std::experimental::wstring_view(L"Venus\0cratered", 14) );
|
||||
#endif
|
||||
VERIFY( u8planet_cratered == u8string_view(u8"Mars\0cratered", 13) );
|
||||
VERIFY( u16planet_cratered ==
|
||||
std::experimental::u16string_view(u"Jupiter\0cratered", 16) );
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
void
|
||||
test01()
|
||||
{
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
std::experimental::wstring_view ws(L"Hello, World!");
|
||||
(void) std::begin(ws);
|
||||
(void) std::end(ws);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -38,11 +38,9 @@ __gnu_test::basic_types<std::experimental::string_view> t1b;
|
|||
__gnu_test::reversible_types<std::experimental::string_view> t1r;
|
||||
typedef typename std::experimental::string_view::traits_type traits_type1;
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
__gnu_test::basic_types<std::experimental::wstring_view> t2b;
|
||||
__gnu_test::reversible_types<std::experimental::wstring_view> t2r;
|
||||
typedef typename std::experimental::wstring_view::traits_type traits_type2;
|
||||
#endif
|
||||
|
||||
static_assert(
|
||||
std::is_same<std::experimental::string_view::pointer, char*>(),
|
||||
|
|
|
@ -33,7 +33,4 @@ using check4_t = std::experimental::fundamentals_v1::u16string_view;
|
|||
using check5_t = std::experimental::fundamentals_v1::u32string_view;
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
using check6_t = std::experimental::fundamentals_v1::wstring_view;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ test01()
|
|||
(void) std::begin(s);
|
||||
(void) std::end(s);
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
__gnu_cxx::__wvstring ws(L"Hello, World!");
|
||||
(void) std::begin(ws);
|
||||
(void) std::end(ws);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -39,9 +39,7 @@ static_assert( std::integral<bool> );
|
|||
static_assert( std::integral<char> );
|
||||
static_assert( std::integral<char16_t> );
|
||||
static_assert( std::integral<char32_t> );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert( std::integral<wchar_t> );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
static_assert( std::integral<char8_t> );
|
||||
#endif
|
||||
|
|
|
@ -39,9 +39,7 @@ static_assert( !std::signed_integral<bool> );
|
|||
static_assert( std::is_signed_v<char> ? std::signed_integral<char> : true );
|
||||
static_assert( !std::signed_integral<char16_t> );
|
||||
static_assert( !std::signed_integral<char32_t> );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert( std::is_signed_v<wchar_t> ? std::signed_integral<wchar_t> : true );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
static_assert( !std::signed_integral<char8_t> );
|
||||
#endif
|
||||
|
|
|
@ -39,9 +39,7 @@ static_assert( std::unsigned_integral<bool> );
|
|||
static_assert( std::is_signed_v<char> ? true : std::unsigned_integral<char> );
|
||||
static_assert( std::unsigned_integral<char16_t> );
|
||||
static_assert( std::unsigned_integral<char32_t> );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
static_assert( std::is_signed_v<wchar_t> ? true : std::unsigned_integral<wchar_t> );
|
||||
#endif
|
||||
#ifdef _GLIBCXX_USE_CHAR8_T
|
||||
static_assert( std::unsigned_integral<char8_t> );
|
||||
#endif
|
||||
|
|
|
@ -33,9 +33,7 @@ void test01()
|
|||
VERIFY( (test_category<is_arithmetic, char>(true)) );
|
||||
VERIFY( (test_category<is_arithmetic, signed char>(true)) );
|
||||
VERIFY( (test_category<is_arithmetic, unsigned char>(true)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_arithmetic, wchar_t>(true)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_arithmetic, short>(true)) );
|
||||
VERIFY( (test_category<is_arithmetic, unsigned short>(true)) );
|
||||
VERIFY( (test_category<is_arithmetic, int>(true)) );
|
||||
|
|
|
@ -32,9 +32,7 @@ void test01()
|
|||
VERIFY( (test_category<is_compound, char>(false)) );
|
||||
VERIFY( (test_category<is_compound, signed char>(false)) );
|
||||
VERIFY( (test_category<is_compound, unsigned char>(false)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_compound, wchar_t>(false)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_compound, short>(false)) );
|
||||
VERIFY( (test_category<is_compound, unsigned short>(false)) );
|
||||
VERIFY( (test_category<is_compound, int>(false)) );
|
||||
|
|
|
@ -32,9 +32,7 @@ void test01()
|
|||
VERIFY( (test_category<is_floating_point, char>(false)) );
|
||||
VERIFY( (test_category<is_floating_point, signed char>(false)) );
|
||||
VERIFY( (test_category<is_floating_point, unsigned char>(false)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_floating_point, wchar_t>(false)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_floating_point, short>(false)) );
|
||||
VERIFY( (test_category<is_floating_point, unsigned short>(false)) );
|
||||
VERIFY( (test_category<is_floating_point, int>(false)) );
|
||||
|
|
|
@ -32,9 +32,7 @@ void test01()
|
|||
VERIFY( (test_category<is_fundamental, char>(true)) );
|
||||
VERIFY( (test_category<is_fundamental, signed char>(true)) );
|
||||
VERIFY( (test_category<is_fundamental, unsigned char>(true)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_fundamental, wchar_t>(true)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_fundamental, short>(true)) );
|
||||
VERIFY( (test_category<is_fundamental, unsigned short>(true)) );
|
||||
VERIFY( (test_category<is_fundamental, int>(true)) );
|
||||
|
|
|
@ -33,9 +33,7 @@ void test01()
|
|||
VERIFY( (test_category<is_integral, char>(true)) );
|
||||
VERIFY( (test_category<is_integral, signed char>(true)) );
|
||||
VERIFY( (test_category<is_integral, unsigned char>(true)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_integral, wchar_t>(true)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_integral, short>(true)) );
|
||||
VERIFY( (test_category<is_integral, unsigned short>(true)) );
|
||||
VERIFY( (test_category<is_integral, int>(true)) );
|
||||
|
|
|
@ -33,9 +33,7 @@ void test01()
|
|||
VERIFY( (test_category<is_signed, char>(false)) );
|
||||
VERIFY( (test_category<is_signed, signed char>(true)) );
|
||||
VERIFY( (test_category<is_signed, unsigned char>(false)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_signed, wchar_t>(false)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_signed, short>(true)) );
|
||||
VERIFY( (test_category<is_signed, unsigned short>(false)) );
|
||||
VERIFY( (test_category<is_signed, int>(true)) );
|
||||
|
|
|
@ -33,9 +33,7 @@ void test01()
|
|||
VERIFY( (test_category<is_unsigned, char>(false)) );
|
||||
VERIFY( (test_category<is_unsigned, signed char>(false)) );
|
||||
VERIFY( (test_category<is_unsigned, unsigned char>(true)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_unsigned, wchar_t>(false)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_unsigned, short>(false)) );
|
||||
VERIFY( (test_category<is_unsigned, unsigned short>(true)) );
|
||||
VERIFY( (test_category<is_unsigned, int>(false)) );
|
||||
|
|
|
@ -33,9 +33,7 @@ void test01()
|
|||
VERIFY( (test_category<is_void, char>(false)) );
|
||||
VERIFY( (test_category<is_void, signed char>(false)) );
|
||||
VERIFY( (test_category<is_void, unsigned char>(false)) );
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
VERIFY( (test_category<is_void, wchar_t>(false)) );
|
||||
#endif
|
||||
VERIFY( (test_category<is_void, short>(false)) );
|
||||
VERIFY( (test_category<is_void, unsigned short>(false)) );
|
||||
VERIFY( (test_category<is_void, int>(false)) );
|
||||
|
|
|
@ -58,10 +58,8 @@ void test01()
|
|||
do_test<double>();
|
||||
do_test<long double>();
|
||||
|
||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||
do_test<wchar_t>();
|
||||
do_test<std::wstring>();
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
|
|
Loading…
Reference in New Issue