/**/
_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 <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
~__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 <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;
-
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
+#endif
_LIBCPP_END_NAMESPACE_STD
//
// The char type of the stream and the char_type of the traits have to match
+// UNSUPPORTED: no-wide-characters
+
#include <fstream>
int main(int, char**)
// The char type of the stream and the char_type of the traits have to match
+// UNSUPPORTED: no-wide-characters
+
#include <fstream>
int main(int, char**)
#include <string_view>
#include <vector>
+#include "test_macros.h"
+
template <class CharT>
struct data {
/// The input to parse.
/// 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<data<wchar_t>, 602> data_utf16 = {{
{L"\U00000020\U00000020", {32, 32}, {1, 2}},
{L"\U00000020\U00000308\U00000020", {32, 32}, {2, 3}},
{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
int main(int, char**)
{
test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
test<wchar_t>();
+#endif
- return 0;
+ return 0;
}
std::basic_string{std::declval<Iter>(), std::declval<Iter>(), std::declval<Alloc>()}
)> : std::true_type { };
-static_assert( CanDeduce<int*, std::allocator<int>>::value);
+static_assert( CanDeduce<char*, std::allocator<char>>::value);
static_assert(!CanDeduce<NotAnIterator, std::allocator<char>>::value);
static_assert(!CanDeduce<NotAnInputIterator, std::allocator<char16_t>>::value);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+static_assert( CanDeduce<wchar_t*, std::allocator<wchar_t>>::value);
static_assert(!CanDeduce<wchar_t const*, NotAnAllocator<wchar_t>>::value);
+#endif
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<wchar_t>{}};
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<char16_t>{}};
// <string>
// The strings's value type must be the same as the traits's char_type
+// UNSUPPORTED: no-wide-characters
+
#include <string>
std::basic_string<char, std::char_traits<wchar_t> > s; // expected-error@*:* {{traits_type::char_type must be the same type as CharT}}
int main(int, char**)
{
test<test_traits<char>, test_allocator<char> >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
test<std::char_traits<wchar_t>, std::allocator<wchar_t> >();
+#endif
static_assert((std::is_same<std::basic_string<char>::traits_type,
std::char_traits<char> >::value), "");
static_assert((std::is_same<std::basic_string<char>::allocator_type,
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 );
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 ));
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 );
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 ));
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 );
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" );
}
#endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
test ( L"QBCDE", 5 );
test ( L"QBCDE", 2 );
test ( L"", 0 );
static_assert ( sv1.data() == s, "" );
}
#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
#if TEST_STD_VER >= 11
test ( u"QBCDE", 5 );
test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0);
}
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
test(L"", L"", 0);
test(L"", L"abcde", -5);
test(L"abcdefghijklmnopqrst", L"abcdefghij", 10);
test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0);
}
+#endif
#if TEST_STD_VER >= 11
{
test("abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), "abcdefghijklmnopqrst", 0);
}
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
test(L"", 0, 0, L"", 0);
test(L"", 0, 0, L"abcde", -5);
test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10);
test(L"abcdefghijklmnopqrst", 0, static_cast<size_t>(-1), L"abcdefghijklmnopqrst", 0);
}
+#endif
#if TEST_STD_VER >= 11
{
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
{
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);
test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 1, 0);
test(L"abcdefghijklmnopqrst", 10, 0, L"abcdefghij", 10, -10);
}
+#endif
#if TEST_STD_VER >= 11
{
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
{
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);
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);
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" );
#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");
#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"));
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" );
int main(int, char**)
{
test<std::char_traits<char> >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
test<std::char_traits<wchar_t> >();
+#endif
#ifndef TEST_HAS_NO_CHAR8_T
test<std::char_traits<char8_t> >();
#endif
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
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
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
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
#include <string_view>
#include <vector>
+#include "test_macros.h"
+
template <class CharT>
struct data {{
/// The input to parse.
/// 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<data<wchar_t>, {0}> data_utf16 = {{{{
{2}}}}};
/// values.
std::array<data<wchar_t>, {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"""