From 3465f0225906d42baf0c5e674ad583d0cac32640 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Mon, 21 Nov 2022 09:50:31 -0500 Subject: [PATCH] [libc++][NFC] Add missing conditionals for the existence of wide characters Differential Revision: https://reviews.llvm.org/D138435 --- libcxx/include/locale | 4 ++++ libcxx/include/streambuf | 6 ++++-- .../file.streams/fstreams/filebuf/traits_mismatch.fail.cpp | 2 ++ .../input.output/file.streams/fstreams/traits_mismatch.fail.cpp | 2 ++ .../format.string/format.string.std/extended_grapheme_cluster.h | 4 ++++ .../std/re/re.iter/re.tokiter/re.tokiter.cnstr/default.pass.cpp | 4 +++- .../strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp | 7 ++++++- libcxx/test/std/strings/basic.string/traits_mismatch.verify.cpp | 2 ++ libcxx/test/std/strings/basic.string/types.pass.cpp | 2 ++ libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp | 2 ++ .../test/std/strings/string.view/string.view.access/back.pass.cpp | 2 ++ .../test/std/strings/string.view/string.view.access/data.pass.cpp | 2 ++ .../test/std/strings/string.view/string.view.access/front.pass.cpp | 2 ++ .../test/std/strings/string.view/string.view.access/index.pass.cpp | 2 ++ .../std/strings/string.view/string.view.cons/from_literal.pass.cpp | 2 ++ .../std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp | 2 ++ .../strings/string.view/string.view.ops/compare.pointer.pass.cpp | 2 ++ .../string.view/string.view.ops/compare.pointer_size.pass.cpp | 2 ++ .../string.view/string.view.ops/compare.size_size_sv.pass.cpp | 2 ++ .../string.view.ops/compare.size_size_sv_pointer_size.pass.cpp | 2 ++ .../string.view.ops/compare.size_size_sv_size_size.pass.cpp | 2 ++ .../std/strings/string.view/string.view.ops/compare.sv.pass.cpp | 2 ++ libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp | 6 ++++++ .../test/std/strings/string.view/string.view.ops/substr.pass.cpp | 2 ++ libcxx/test/std/strings/string.view/types.pass.cpp | 2 ++ .../format/format.formatter/format.parse.ctx/advance_to.pass.cpp | 2 ++ .../format/format.formatter/format.parse.ctx/begin.pass.cpp | 2 ++ .../format/format.formatter/format.parse.ctx/ctor.pass.cpp | 2 ++ .../format/format.formatter/format.parse.ctx/end.pass.cpp | 2 ++ libcxx/utils/generate_extended_grapheme_cluster_test.py | 4 ++++ 30 files changed, 77 insertions(+), 4 deletions(-) diff --git a/libcxx/include/locale b/libcxx/include/locale index 8a330ae..015efd8 100644 --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -2385,7 +2385,9 @@ extern template _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::string_type __time_ /**/ _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(wchar_t) +#endif #undef _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION template > @@ -2445,8 +2447,10 @@ protected: ~__time_put(); void __do_put(char* __nb, char*& __ne, const tm* __tm, char __fmt, char __mod) const; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS void __do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm, char __fmt, char __mod) const; +#endif }; template > diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf index 53a7172..d473df1 100644 --- a/libcxx/include/streambuf +++ b/libcxx/include/streambuf @@ -489,10 +489,12 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type) } extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf; - extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf; extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios; +#endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp index c607c63..27871b0 100644 --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp @@ -13,6 +13,8 @@ // // The char type of the stream and the char_type of the traits have to match +// UNSUPPORTED: no-wide-characters + #include int main(int, char**) diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp index 545530b..ce22fee 100644 --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp @@ -13,6 +13,8 @@ // The char type of the stream and the char_type of the traits have to match +// UNSUPPORTED: no-wide-characters + #include int main(int, char**) diff --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h index e66d4b1..f281222 100644 --- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h +++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.h @@ -65,6 +65,8 @@ #include #include +#include "test_macros.h" + template struct data { /// The input to parse. @@ -689,6 +691,7 @@ std::array, 602> data_utf8 = {{ /// Note that most of the data for the UTF-16 and UTF-32 are identical. However /// since the size of the code units differ the breaks can contain different /// values. +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::array, 602> data_utf16 = {{ {L"\U00000020\U00000020", {32, 32}, {1, 2}}, {L"\U00000020\U00000308\U00000020", {32, 32}, {2, 3}}, @@ -1901,5 +1904,6 @@ std::array, 602> data_utf32 = {{ {L"\U00000061\U0000200d\U0001f6d1", {97, 128721}, {2, 3}}, {L"\U00002701\U0000200d\U00002701", {9985}, {3}}, {L"\U00000061\U0000200d\U00002701", {97, 9985}, {2, 3}}}}; +#endif // TEST_HAS_NO_WIDE_CHARACTERS #endif // LIBCXX_TEST_STD_UTILITIES_FORMAT_FORMAT_STRING_FORMAT_STRING_STD_EXTENDED_GRAPHEME_CLUSTER_H diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/default.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/default.pass.cpp index bb70095..4a028fc 100644 --- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/default.pass.cpp +++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/default.pass.cpp @@ -28,7 +28,9 @@ test() int main(int, char**) { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif - return 0; + return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp index 72604a7..d6db253 100644 --- a/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp @@ -44,10 +44,13 @@ struct CanDeduce(), std::declval(), std::declval()} )> : std::true_type { }; -static_assert( CanDeduce>::value); +static_assert( CanDeduce>::value); static_assert(!CanDeduce>::value); static_assert(!CanDeduce>::value); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +static_assert( CanDeduce>::value); static_assert(!CanDeduce>::value); +#endif TEST_CONSTEXPR_CXX20 bool test() { { @@ -70,6 +73,7 @@ TEST_CONSTEXPR_CXX20 bool test() { assert(s1.size() == 10); assert(s1.compare(0, s1.size(), s, s1.size()) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const wchar_t* s = L"12345678901234"; std::basic_string s1{s, s+10, test_allocator{}}; @@ -80,6 +84,7 @@ TEST_CONSTEXPR_CXX20 bool test() { assert(s1.size() == 10); assert(s1.compare(0, s1.size(), s, s1.size()) == 0); } +#endif { const char16_t* s = u"12345678901234"; std::basic_string s1{s, s+10, min_allocator{}}; diff --git a/libcxx/test/std/strings/basic.string/traits_mismatch.verify.cpp b/libcxx/test/std/strings/basic.string/traits_mismatch.verify.cpp index 6730e2f..82c438b 100644 --- a/libcxx/test/std/strings/basic.string/traits_mismatch.verify.cpp +++ b/libcxx/test/std/strings/basic.string/traits_mismatch.verify.cpp @@ -9,6 +9,8 @@ // // The strings's value type must be the same as the traits's char_type +// UNSUPPORTED: no-wide-characters + #include std::basic_string > s; // expected-error@*:* {{traits_type::char_type must be the same type as CharT}} diff --git a/libcxx/test/std/strings/basic.string/types.pass.cpp b/libcxx/test/std/strings/basic.string/types.pass.cpp index 910b336..542336b 100644 --- a/libcxx/test/std/strings/basic.string/types.pass.cpp +++ b/libcxx/test/std/strings/basic.string/types.pass.cpp @@ -74,7 +74,9 @@ test() int main(int, char**) { test, test_allocator >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test, std::allocator >(); +#endif static_assert((std::is_same::traits_type, std::char_traits >::value), ""); static_assert((std::is_same::allocator_type, diff --git a/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp index 82da10d..99a81ac 100644 --- a/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.access/at.pass.cpp @@ -35,8 +35,10 @@ int main(int, char**) { test ( "ABCDE", 5 ); test ( "a", 1 ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDE", 5 ); test ( L"a", 1 ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDE", 5 ); diff --git a/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp index d5a21bb3..49b84ab 100644 --- a/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp @@ -32,8 +32,10 @@ int main(int, char**) { assert ( test ( "ABCDE", 5 )); assert ( test ( "a", 1 )); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert ( test ( L"ABCDE", 5 )); assert ( test ( L"a", 1 )); +#endif #if TEST_STD_VER >= 11 assert ( test ( u"ABCDE", 5 )); diff --git a/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp index 1c8540a..50d2a14 100644 --- a/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.access/data.pass.cpp @@ -33,8 +33,10 @@ int main(int, char**) { test ( "ABCDE", 5 ); test ( "a", 1 ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDE", 5 ); test ( L"a", 1 ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDE", 5 ); diff --git a/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp index 900a698..d9e1607 100644 --- a/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp @@ -32,8 +32,10 @@ int main(int, char**) { assert ( test ( "ABCDE", 5 )); assert ( test ( "a", 1 )); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert ( test ( L"ABCDE", 5 )); assert ( test ( L"a", 1 )); +#endif #if TEST_STD_VER >= 11 assert ( test ( u"ABCDE", 5 )); diff --git a/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp b/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp index 493787a..b27bc65 100644 --- a/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp @@ -34,8 +34,10 @@ int main(int, char**) { test ( "ABCDE", 5 ); test ( "a", 1 ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDE", 5 ); test ( L"a", 1 ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDE", 5 ); diff --git a/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp index b58a838..124aaea 100644 --- a/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp @@ -45,9 +45,11 @@ int main(int, char**) { test ( "A" ); test ( "" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"QBCDE" ); test ( L"A" ); test ( L"" ); +#endif #if TEST_STD_VER >= 11 test ( u"QBCDE" ); diff --git a/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp index 540fa74..8d48f90 100644 --- a/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp @@ -45,6 +45,7 @@ int main(int, char**) { } #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"QBCDE", 5 ); test ( L"QBCDE", 2 ); test ( L"", 0 ); @@ -56,6 +57,7 @@ int main(int, char**) { static_assert ( sv1.data() == s, "" ); } #endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS #if TEST_STD_VER >= 11 test ( u"QBCDE", 5 ); diff --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp index 3133939..ed06bec 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer.pass.cpp @@ -55,6 +55,7 @@ int main(int, char**) test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test(L"", L"", 0); test(L"", L"abcde", -5); @@ -73,6 +74,7 @@ int main(int, char**) test(L"abcdefghijklmnopqrst", L"abcdefghij", 10); test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0); } +#endif #if TEST_STD_VER >= 11 { diff --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp index d21a0c5..a7a5c30 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp @@ -381,6 +381,7 @@ int main(int, char**) test("abcdefghijklmnopqrst", 0, static_cast(-1), "abcdefghijklmnopqrst", 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test(L"", 0, 0, L"", 0); test(L"", 0, 0, L"abcde", -5); @@ -399,6 +400,7 @@ int main(int, char**) test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10); test(L"abcdefghijklmnopqrst", 0, static_cast(-1), L"abcdefghijklmnopqrst", 0); } +#endif #if TEST_STD_VER >= 11 { diff --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp index e4dd2c5..477bfdd 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv.pass.cpp @@ -368,12 +368,14 @@ int main(int, char**) { test("ABCde", 2, 4, "abcde", -1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test(L"abcde", 5, 1, L"", 0); test(L"abcde", 2, 4, L"", 3); test(L"abcde", 2, 4, L"abcde", 2); test(L"ABCde", 2, 4, L"abcde", -1); } +#endif #if TEST_STD_VER >= 11 { diff --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp index 57a0b13..f0c4a79 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp @@ -1315,6 +1315,7 @@ int main(int, char**) { test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, -10); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test(L"", 0, 0, L"abcde", 0, 0); test(L"", 0, 0, L"abcde", 1, -1); @@ -1322,6 +1323,7 @@ int main(int, char**) { test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 1, 0); test(L"abcdefghijklmnopqrst", 10, 0, L"abcdefghij", 10, -10); } +#endif #if TEST_STD_VER >= 11 { diff --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp index 3ea44ae..a0f661c 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp @@ -5814,12 +5814,14 @@ int main(int, char**) { test("ABCde", 2, 4, "abcde", 2, 4, -1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test(L"abcde", 5, 1, L"", 0, 0, 0); test(L"abcde", 2, 4, L"", 0, 0, 3); test(L"abcde", 2, 4, L"abcde", 3, 4, -2); test(L"ABCde", 2, 4, L"abcde", 2, 4, -1); } +#endif #if TEST_STD_VER >= 11 { diff --git a/libcxx/test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp index ff68706..7db327d 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/compare.sv.pass.cpp @@ -55,6 +55,7 @@ int main(int, char**) { test("abcdefghijklmnopqrst", "abcdefghij", 10); test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(L"", L"", 0); test(L"", L"abcde", -5); test(L"", L"abcdefghij", -10); @@ -71,6 +72,7 @@ int main(int, char**) { test(L"abcdefghijklmnopqrst", L"abcde", 15); test(L"abcdefghijklmnopqrst", L"abcdefghij", 10); test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0); +#endif #if TEST_STD_VER >= 11 test(u"", u"", 0); diff --git a/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp index 709e265..54e185f 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp @@ -93,10 +93,12 @@ int main(int, char**) { test ( "a" ); test ( "" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); test ( L"ABCDE" ); test ( L"a" ); test ( L"" ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); @@ -111,7 +113,9 @@ int main(int, char**) { #endif test_constexpr_copy("ABCDE", "GHIJK", "BCDJK"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_constexpr_copy(L"ABCDE", L"GHIJK", L"BCDJK"); +#endif #if TEST_STD_VER >= 11 test_constexpr_copy(u"ABCDE", u"GHIJK", u"BCDJK"); test_constexpr_copy(U"ABCDE", U"GHIJK", U"BCDJK"); @@ -121,7 +125,9 @@ int main(int, char**) { #endif #if TEST_STD_VER >= 20 static_assert(test_constexpr_copy("ABCDE", "GHIJK", "BCDJK")); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(test_constexpr_copy(L"ABCDE", L"GHIJK", L"BCDJK")); +#endif static_assert(test_constexpr_copy(u"ABCDE", u"GHIJK", u"BCDJK")); static_assert(test_constexpr_copy(U"ABCDE", U"GHIJK", U"BCDJK")); static_assert(test_constexpr_copy(u8"ABCDE", u8"GHIJK", u8"BCDJK")); diff --git a/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp index c2b9511..92f9d8c 100644 --- a/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.ops/substr.pass.cpp @@ -77,10 +77,12 @@ int main(int, char**) { test ( "a" ); test ( "" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); test ( L"ABCDE" ); test ( L"a" ); test ( L"" ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); diff --git a/libcxx/test/std/strings/string.view/types.pass.cpp b/libcxx/test/std/strings/string.view/types.pass.cpp index e9d3d24..f952f20 100644 --- a/libcxx/test/std/strings/string.view/types.pass.cpp +++ b/libcxx/test/std/strings/string.view/types.pass.cpp @@ -72,7 +72,9 @@ test() int main(int, char**) { test >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test >(); +#endif #ifndef TEST_HAS_NO_CHAR8_T test >(); #endif diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/advance_to.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/advance_to.pass.cpp index 6b4afcb..1a69942 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/advance_to.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/advance_to.pass.cpp @@ -50,7 +50,9 @@ constexpr void test(const CharT* fmt) { constexpr bool test() { test("abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(L"abc"); +#endif #ifndef TEST_HAS_NO_CHAR8_T test(u8"abc"); #endif diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/begin.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/begin.pass.cpp index 63122dc..df3563e 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/begin.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/begin.pass.cpp @@ -36,7 +36,9 @@ constexpr void test(const CharT* fmt) { constexpr bool test() { test("abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(L"abc"); +#endif #ifndef TEST_HAS_NO_CHAR8_T test(u8"abc"); #endif diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/ctor.pass.cpp index 08cd9d5..8b1601e 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/ctor.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/ctor.pass.cpp @@ -57,7 +57,9 @@ constexpr void test(const CharT* fmt) { constexpr bool test() { test("abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(L"abc"); +#endif #ifndef TEST_HAS_NO_CHAR8_T test(u8"abc"); #endif diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/end.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/end.pass.cpp index e135418..e1d0f2f 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/end.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/end.pass.cpp @@ -36,7 +36,9 @@ constexpr void test(const CharT* fmt) { constexpr bool test() { test("abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(L"abc"); +#endif #ifndef TEST_HAS_NO_CHAR8_T test(u8"abc"); #endif diff --git a/libcxx/utils/generate_extended_grapheme_cluster_test.py b/libcxx/utils/generate_extended_grapheme_cluster_test.py index c263cdd..5061c80 100755 --- a/libcxx/utils/generate_extended_grapheme_cluster_test.py +++ b/libcxx/utils/generate_extended_grapheme_cluster_test.py @@ -156,6 +156,8 @@ cpp_template = """// -*- C++ -*- #include #include +#include "test_macros.h" + template struct data {{ /// The input to parse. @@ -179,6 +181,7 @@ std::array, {0}> data_utf8 = {{{{ /// Note that most of the data for the UTF-16 and UTF-32 are identical. However /// since the size of the code units differ the breaks can contain different /// values. +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::array, {0}> data_utf16 = {{{{ {2}}}}}; @@ -189,6 +192,7 @@ std::array, {0}> data_utf16 = {{{{ /// values. std::array, {0}> data_utf32 = {{{{ {3}}}}}; +#endif // TEST_HAS_NO_WIDE_CHARACTERS #endif // LIBCXX_TEST_STD_UTILITIES_FORMAT_FORMAT_STRING_FORMAT_STRING_STD_EXTENDED_GRAPHEME_CLUSTER_H""" -- 2.7.4