diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -120,6 +120,12 @@ "Whether to include support for Unicode in the library. Disabling Unicode can be useful when porting to platforms that don't support UTF-8 encoding (e.g. embedded)." ON) +option(LIBCXX_ENABLE_WIDE_CHARACTERS + "Whether to include support for wide characters in the library. Disabling + wide character support can be useful when porting to platforms that don't + support the C functionality for wide characters. When wide characters are + not supported, several parts of the library will be disabled, notably the + wide character specializations of std::basic_string." ON) option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS "Whether to turn on vendor availability annotations on declarations that depend on definitions in a shared library. By default, we assume that we're not building @@ -893,6 +899,7 @@ config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE) config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION) config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE) +config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS) config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) # Incomplete features get their own specific disabling flags. This makes it # easier to grep for target specific flags once the feature is complete. diff --git a/libcxx/cmake/caches/Generic-no-wide-characters.cmake b/libcxx/cmake/caches/Generic-no-wide-characters.cmake new file mode 100644 --- /dev/null +++ b/libcxx/cmake/caches/Generic-no-wide-characters.cmake @@ -0,0 +1 @@ +set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "") diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst --- a/libcxx/docs/BuildingLibcxx.rst +++ b/libcxx/docs/BuildingLibcxx.rst @@ -251,6 +251,15 @@ This option can be used to enable or disable the filesystem components on platforms that may not support them. For example on Windows when using MSVC. +.. option:: LIBCXX_ENABLE_WIDE_CHARACTERS:BOOL + + **Default**: ``ON`` + + This option can be used to disable support for ``wchar_t`` in the library. It also + allows the library to work on top of a C Standard Library that does not provide + support for ``wchar_t``. This is especially useful in embedded settings where + C Standard Libraries don't always provide all the usual bells and whistles. + .. option:: LIBCXX_ENABLE_INCOMPLETE_FEATURES:BOOL **Default**: ``ON`` diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -49,7 +49,9 @@ API Changes ----------- -- ... +- Support for building libc++ on top of a C Standard Library that does not support ``wchar_t`` was + added. This is useful for building libc++ in an embedded setting, and it adds itself to the various + freestanding-friendly options provided by libc++. Build System Changes -------------------- diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -211,6 +211,7 @@ __iterator/wrap_iter.h __libcpp_version __locale + __mbstate_t.h __memory/addressof.h __memory/allocation_guard.h __memory/allocator_arg_t.h diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -463,7 +463,9 @@ } _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, char*>(char*, char*, __less&)) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) +#endif _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, signed char*>(signed char*, signed char*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, short*>(short*, short*, __less&)) @@ -479,7 +481,9 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, long double*>(long double*, long double*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, char*>(char*, char*, __less&)) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) +#endif _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, signed char*>(signed char*, signed char*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, short*>(short*, short*, __less&)) diff --git a/libcxx/include/__bsd_locale_fallbacks.h b/libcxx/include/__bsd_locale_fallbacks.h --- a/libcxx/include/__bsd_locale_fallbacks.h +++ b/libcxx/include/__bsd_locale_fallbacks.h @@ -30,6 +30,7 @@ return MB_CUR_MAX; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_btowc_l(int __c, locale_t __l) { @@ -88,6 +89,7 @@ __libcpp_locale_guard __current(__l); return mbrlen(__s, __n, __ps); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY lconv *__libcpp_localeconv_l(locale_t __l) @@ -96,6 +98,7 @@ return localeconv(); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len, mbstate_t *__ps, locale_t __l) @@ -103,6 +106,7 @@ __libcpp_locale_guard __current(__l); return mbsrtowcs(__dest, __src, __len, __ps); } +#endif inline int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) { diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1241,6 +1241,16 @@ #define _LIBCPP_PREFERRED_NAME(x) #endif +// We often repeat things just for handling wide characters in the library. +// When wide characters are disabled, it can be useful to have a quick way of +// disabling it without having to resort to #if-#endif, which has a larger +// impact on readability. +#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# define _LIBCPP_IF_WIDE_CHARACTERS(...) +#else +# define _LIBCPP_IF_WIDE_CHARACTERS(...) __VA_ARGS__ +#endif + #if defined(_LIBCPP_ABI_MICROSOFT) && \ (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases)) # define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases) diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in --- a/libcxx/include/__config_site.in +++ b/libcxx/include/__config_site.in @@ -30,6 +30,7 @@ #cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS #cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE #cmakedefine _LIBCPP_HAS_NO_LOCALIZATION +#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES diff --git a/libcxx/include/__format/format_context.h b/libcxx/include/__format/format_context.h --- a/libcxx/include/__format/format_context.h +++ b/libcxx/include/__format/format_context.h @@ -146,8 +146,9 @@ // (such as a span) and polymorphic reallocation. - end note] using format_context = basic_format_context, char>; -using wformat_context = - basic_format_context, wchar_t>; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +using wformat_context = basic_format_context, wchar_t>; +#endif #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) diff --git a/libcxx/include/__format/format_parse_context.h b/libcxx/include/__format/format_parse_context.h --- a/libcxx/include/__format/format_parse_context.h +++ b/libcxx/include/__format/format_parse_context.h @@ -96,7 +96,9 @@ }; using format_parse_context = basic_format_parse_context; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using wformat_parse_context = basic_format_parse_context; +#endif #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) diff --git a/libcxx/include/__format/formatter_bool.h b/libcxx/include/__format/formatter_bool.h --- a/libcxx/include/__format/formatter_bool.h +++ b/libcxx/include/__format/formatter_bool.h @@ -85,11 +85,13 @@ static constexpr string_view __false{"false"}; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> struct _LIBCPP_TEMPLATE_VIS __bool_strings { static constexpr wstring_view __true{L"true"}; static constexpr wstring_view __false{L"false"}; }; +#endif template using __formatter_bool = __formatter_integral<__parser_bool<_CharT>>; diff --git a/libcxx/include/__format/formatter_char.h b/libcxx/include/__format/formatter_char.h --- a/libcxx/include/__format/formatter_char.h +++ b/libcxx/include/__format/formatter_char.h @@ -78,6 +78,7 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter : public __format_spec::__formatter_char {}; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter : public __format_spec::__formatter_char { @@ -93,7 +94,7 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter : public __format_spec::__formatter_char {}; - +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) #endif //_LIBCPP_STD_VER > 17 diff --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h --- a/libcxx/include/__functional/hash.h +++ b/libcxx/include/__functional/hash.h @@ -561,6 +561,7 @@ #endif // _LIBCPP_HAS_NO_UNICODE_CHARS +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> struct _LIBCPP_TEMPLATE_VIS hash @@ -576,6 +577,7 @@ _LIBCPP_INLINE_VISIBILITY size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast(__v);} }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -338,7 +338,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate) +#endif // template class collate_byname; @@ -363,6 +365,7 @@ virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS collate_byname : public collate @@ -382,6 +385,7 @@ const char_type* __lo2, const char_type* __hi2) const; virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const; }; +#endif template bool @@ -516,6 +520,7 @@ template class _LIBCPP_TEMPLATE_VIS ctype; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS ctype : public locale::facet, @@ -617,6 +622,7 @@ virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS ctype @@ -761,6 +767,7 @@ virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS ctype_byname : public ctype @@ -786,6 +793,7 @@ virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template inline _LIBCPP_INLINE_VISIBILITY @@ -992,6 +1000,7 @@ // template <> class codecvt +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS codecvt : public locale::facet, @@ -1072,6 +1081,7 @@ virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; virtual int do_max_length() const _NOEXCEPT; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // template <> class codecvt // deprecated in C++20 @@ -1450,7 +1460,9 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) +#endif _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) // deprecated in C++20 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) // deprecated in C++20 #ifndef _LIBCPP_HAS_NO_CHAR8_T @@ -1681,6 +1693,7 @@ string __grouping_; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS numpunct : public locale::facet @@ -1711,6 +1724,7 @@ char_type __thousands_sep_; string __grouping_; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // template class numpunct_byname @@ -1734,6 +1748,7 @@ void __init(const char*); }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS numpunct_byname : public numpunct @@ -1751,6 +1766,7 @@ private: void __init(const char*); }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h new file mode 100644 --- /dev/null +++ b/libcxx/include/__mbstate_t.h @@ -0,0 +1,44 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MBSTATE_T_H +#define _LIBCPP___MBSTATE_T_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +// TODO(ldionne): +// The goal of this header is to provide mbstate_t without having to pull in +// or . This is necessary because we need that type even +// when we don't have (or try to provide) support for wchar_t, because several +// types like std::fpos are defined in terms of mbstate_t. +// +// This is a gruesome hack, but I don't know how to make it cleaner for +// the time being. + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include // for mbstate_t +#elif __has_include() +# include // works on most Unixes +#elif __has_include() +# include // works on Darwin +#else +# error "The library was configured without support for wide-characters, but we don't know how to get the definition of mbstate_t without on your platform." +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +using ::mbstate_t _LIBCPP_USING_IF_EXISTS; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MBSTATE_T_H diff --git a/libcxx/include/__string b/libcxx/include/__string --- a/libcxx/include/__string +++ b/libcxx/include/__string @@ -23,8 +23,12 @@ #include // for EOF #include // for uint_least16_t #include // for memcpy -#include // for wmemcpy #include // for __libcpp_is_constant_evaluated +#include // for streampos & friends + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include // for wmemcpy +#endif #include <__debug> @@ -423,6 +427,7 @@ // char_traits +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> struct _LIBCPP_TEMPLATE_VIS char_traits { @@ -539,6 +544,7 @@ return nullptr; #endif } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__utility/cmp.h b/libcxx/include/__utility/cmp.h --- a/libcxx/include/__utility/cmp.h +++ b/libcxx/include/__utility/cmp.h @@ -30,14 +30,17 @@ template concept __is_safe_integral_cmp = is_integral_v<_Tp> && - !_IsSameAsAny<_Tp, bool, char, + !_IsSameAsAny<_Tp, bool, char #ifndef _LIBCPP_HAS_NO_CHAR8_T - char8_t, + , char8_t #endif #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS - char16_t, char32_t, + , char16_t, char32_t #endif - wchar_t>::value; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + , wchar_t +#endif + >::value; template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> _LIBCPP_INLINE_VISIBILITY constexpr diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -1473,7 +1473,9 @@ #endif template<> struct __cxx_is_always_lock_free { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template<> struct __cxx_is_always_lock_free { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; }; +#endif template<> struct __cxx_is_always_lock_free { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; }; @@ -2672,7 +2674,9 @@ #endif typedef atomic atomic_char16_t; typedef atomic atomic_char32_t; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef atomic atomic_wchar_t; +#endif typedef atomic atomic_int_least8_t; typedef atomic atomic_uint_least8_t; diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt --- a/libcxx/include/codecvt +++ b/libcxx/include/codecvt @@ -74,6 +74,7 @@ template class __codecvt_utf8; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS __codecvt_utf8 : public codecvt @@ -108,6 +109,7 @@ size_t __mx) const; virtual int do_max_length() const _NOEXCEPT; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> @@ -203,6 +205,7 @@ template class __codecvt_utf16; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt @@ -272,6 +275,7 @@ size_t __mx) const; virtual int do_max_length() const _NOEXCEPT; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> @@ -443,6 +447,7 @@ template class __codecvt_utf8_utf16; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16 : public codecvt @@ -477,6 +482,7 @@ size_t __mx) const; virtual int do_max_length() const _NOEXCEPT; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -58,7 +58,9 @@ template <> struct __libcpp_is_integral { enum { value = 1 }; }; template <> struct __libcpp_is_integral { enum { value = 1 }; }; template <> struct __libcpp_is_integral { enum { value = 1 }; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> struct __libcpp_is_integral { enum { value = 1 }; }; +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T template <> struct __libcpp_is_integral { enum { value = 1 }; }; #endif diff --git a/libcxx/include/experimental/regex b/libcxx/include/experimental/regex --- a/libcxx/include/experimental/regex +++ b/libcxx/include/experimental/regex @@ -52,9 +52,11 @@ polymorphic_allocator<_VSTD::sub_match<_BiDirIter>>>; typedef match_results cmatch; -typedef match_results wcmatch; typedef match_results<_VSTD_LFTS_PMR::string::const_iterator> smatch; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +typedef match_results wcmatch; typedef match_results<_VSTD_LFTS_PMR::wstring::const_iterator> wsmatch; +#endif _LIBCPP_END_NAMESPACE_LFTS_PMR diff --git a/libcxx/include/experimental/string b/libcxx/include/experimental/string --- a/libcxx/include/experimental/string +++ b/libcxx/include/experimental/string @@ -54,7 +54,9 @@ typedef basic_string string; typedef basic_string u16string; typedef basic_string u32string; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef basic_string wstring; +#endif _LIBCPP_END_NAMESPACE_LFTS_PMR diff --git a/libcxx/include/filesystem b/libcxx/include/filesystem --- a/libcxx/include/filesystem +++ b/libcxx/include/filesystem @@ -1283,9 +1283,11 @@ return __s; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const { return string(); } +#endif _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const { return string(); } @@ -1310,7 +1312,9 @@ return string<_ECharT, _Traits, _Allocator>(__a); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _VSTD::wstring generic_wstring() const { return string(); } +#endif _VSTD::u16string generic_u16string() const { return string(); } _VSTD::u32string generic_u32string() const { return string(); } #endif /* !_LIBCPP_HAS_NO_LOCALIZATION */ diff --git a/libcxx/include/format b/libcxx/include/format --- a/libcxx/include/format +++ b/libcxx/include/format @@ -318,7 +318,9 @@ // to do this optimization now. using format_args = basic_format_args; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using wformat_args = basic_format_args; +#endif template using format_args_t = basic_format_args>; @@ -335,11 +337,14 @@ return {basic_format_arg<_Context>(__args)...}; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_HIDE_FROM_ABI __format_arg_store make_wformat_args(const _Args&... __args) { return _VSTD::make_format_args(__args...); } +#endif + namespace __format { template @@ -363,11 +368,13 @@ __convert(_Uv __value) requires(same_as<_CharT, char>) { return _VSTD::to_string(__value); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_HIDDEN static wstring __convert(_Uv __value) requires(same_as<_CharT, wchar_t>) { return _VSTD::to_wstring(__value); } +#endif template _LIBCPP_HIDDEN auto __handle_format(_Uv __value, auto& __ctx) @@ -514,12 +521,14 @@ return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _OutIt> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(_OutIt __out_it, wstring_view __fmt, format_args_t, wchar_t> __args) { return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args); } +#endif template _OutIt, class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt @@ -529,6 +538,7 @@ _VSTD::make_format_args>(__args...)); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _OutIt, class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to(_OutIt __out_it, wstring_view __fmt, const _Args&... __args) { @@ -537,6 +547,7 @@ _VSTD::make_format_args>( __args...)); } +#endif inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string vformat(string_view __fmt, format_args __args) { @@ -545,12 +556,14 @@ return __res; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring vformat(wstring_view __fmt, wformat_args __args) { wstring __res; _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args); return __res; } +#endif template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string @@ -558,11 +571,13 @@ return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring format(wstring_view __fmt, const _Args&... __args) { return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)); } +#endif template struct _LIBCPP_TEMPLATE_VIS format_to_n_result { @@ -583,6 +598,7 @@ return {_VSTD::move(__out_it), __s}; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _OutIt, class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, wstring_view __fmt, @@ -595,6 +611,7 @@ __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); return {_VSTD::move(__out_it), __s}; } +#endif template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t @@ -603,12 +620,14 @@ return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)).size(); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t formatted_size(wstring_view __fmt, const _Args&... __args) { // TODO FMT Improve PoC: using std::string is inefficient. return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)).size(); } +#endif #ifndef _LIBCPP_HAS_NO_LOCALIZATION @@ -630,6 +649,7 @@ __args); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _OutIt> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(_OutIt __out_it, locale __loc, wstring_view __fmt, @@ -637,6 +657,7 @@ return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt, __args); } +#endif template _OutIt, class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to( @@ -646,6 +667,7 @@ _VSTD::make_format_args>(__args...)); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _OutIt, class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to( _OutIt __out_it, locale __loc, wstring_view __fmt, const _Args&... __args) { @@ -654,6 +676,7 @@ _VSTD::make_format_args>( __args...)); } +#endif inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string vformat(locale __loc, string_view __fmt, format_args __args) { @@ -663,6 +686,7 @@ return __res; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring vformat(locale __loc, wstring_view __fmt, wformat_args __args) { wstring __res; @@ -670,6 +694,7 @@ __args); return __res; } +#endif template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string @@ -678,12 +703,14 @@ _VSTD::make_format_args(__args...)); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring format(locale __loc, wstring_view __fmt, const _Args&... __args) { return _VSTD::vformat(_VSTD::move(__loc), __fmt, _VSTD::make_wformat_args(__args...)); } +#endif template _OutIt, class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> @@ -699,6 +726,7 @@ return {_VSTD::move(__out_it), __s}; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _OutIt, class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt> format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, @@ -712,6 +740,7 @@ __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it)); return {_VSTD::move(__out_it), __s}; } +#endif template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t @@ -722,6 +751,7 @@ .size(); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t formatted_size(locale __loc, wstring_view __fmt, const _Args&... __args) { @@ -730,6 +760,7 @@ _VSTD::make_wformat_args(__args...)) .size(); } +#endif #endif // _LIBCPP_HAS_NO_LOCALIZATION diff --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd --- a/libcxx/include/iosfwd +++ b/libcxx/include/iosfwd @@ -95,7 +95,7 @@ */ #include <__config> -#include // for mbstate_t +#include <__mbstate_t.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -112,7 +112,9 @@ #endif template<> struct char_traits; template<> struct char_traits; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template<> struct char_traits; +#endif template class _LIBCPP_TEMPLATE_VIS allocator; @@ -156,7 +158,9 @@ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator; typedef basic_ios ios; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef basic_ios wios; +#endif typedef basic_streambuf streambuf; typedef basic_istream istream; @@ -173,6 +177,7 @@ typedef basic_ofstream ofstream; typedef basic_fstream fstream; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef basic_streambuf wstreambuf; typedef basic_istream wistream; typedef basic_ostream wostream; @@ -187,36 +192,37 @@ typedef basic_ifstream wifstream; typedef basic_ofstream wofstream; typedef basic_fstream wfstream; +#endif template - class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_PREFERRED_NAME(wios) basic_ios; + class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios; template - class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_PREFERRED_NAME(wstreambuf) basic_streambuf; + class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstreambuf)) basic_streambuf; template - class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_PREFERRED_NAME(wistream) basic_istream; + class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistream)) basic_istream; template - class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_PREFERRED_NAME(wostream) basic_ostream; + class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostream)) basic_ostream; template - class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_PREFERRED_NAME(wiostream) basic_iostream; + class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wiostream)) basic_iostream; template - class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_PREFERRED_NAME(wstringbuf) basic_stringbuf; + class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringbuf)) basic_stringbuf; template - class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_PREFERRED_NAME(wistringstream) basic_istringstream; + class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistringstream)) basic_istringstream; template - class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_PREFERRED_NAME(wostringstream) basic_ostringstream; + class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostringstream)) basic_ostringstream; template - class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_PREFERRED_NAME(wstringstream) basic_stringstream; + class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringstream)) basic_stringstream; template - class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_PREFERRED_NAME(wfilebuf) basic_filebuf; + class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfilebuf)) basic_filebuf; template - class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_PREFERRED_NAME(wifstream) basic_ifstream; + class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wifstream)) basic_ifstream; template - class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_PREFERRED_NAME(wofstream) basic_ofstream; + class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wofstream)) basic_ofstream; template - class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_PREFERRED_NAME(wfstream) basic_fstream; + class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfstream)) basic_fstream; template class _LIBCPP_TEMPLATE_VIS fpos; typedef fpos streampos; @@ -241,10 +247,12 @@ class _Allocator = allocator<_CharT> > class _LIBCPP_TEMPLATE_VIS basic_string; typedef basic_string, allocator > string; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef basic_string, allocator > wstring; +#endif template - class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_PREFERRED_NAME(wstring) basic_string; + class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstring)) basic_string; // Include other forward declarations here template > diff --git a/libcxx/include/iostream b/libcxx/include/iostream --- a/libcxx/include/iostream +++ b/libcxx/include/iostream @@ -46,13 +46,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD extern _LIBCPP_FUNC_VIS istream cin; -extern _LIBCPP_FUNC_VIS wistream wcin; extern _LIBCPP_FUNC_VIS ostream cout; -extern _LIBCPP_FUNC_VIS wostream wcout; extern _LIBCPP_FUNC_VIS ostream cerr; -extern _LIBCPP_FUNC_VIS wostream wcerr; extern _LIBCPP_FUNC_VIS ostream clog; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +extern _LIBCPP_FUNC_VIS wistream wcin; +extern _LIBCPP_FUNC_VIS wostream wcout; +extern _LIBCPP_FUNC_VIS wostream wcerr; extern _LIBCPP_FUNC_VIS wostream wclog; +#endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/istream b/libcxx/include/istream --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -1628,7 +1628,9 @@ } _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream) +#endif _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream) _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -573,7 +573,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get) +#endif template > class _LIBCPP_TEMPLATE_VIS num_get @@ -1111,7 +1113,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get) +#endif struct _LIBCPP_TYPE_VIS __num_put_base { @@ -1261,7 +1265,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put) +#endif template > class _LIBCPP_TEMPLATE_VIS num_put @@ -1694,7 +1700,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put) +#endif template _LIBCPP_HIDDEN @@ -1761,6 +1769,7 @@ template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage::__x() const; template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage::__X() const; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage::__weeks() const; template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage::__months() const; template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage::__am_pm() const; @@ -1768,6 +1777,7 @@ template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage::__r() const; template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage::__x() const; template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage::__X() const; +#endif template > class _LIBCPP_TEMPLATE_VIS time_get @@ -2380,7 +2390,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get) +#endif class _LIBCPP_TYPE_VIS __time_get { @@ -2480,7 +2492,9 @@ }; _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname) +#endif class _LIBCPP_TYPE_VIS __time_put { @@ -2593,7 +2607,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put) +#endif template > class _LIBCPP_TEMPLATE_VIS time_put_byname @@ -2614,7 +2630,9 @@ }; _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname) +#endif // money_base @@ -2682,8 +2700,10 @@ _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct) _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct) _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct) +#endif // moneypunct_byname @@ -2734,13 +2754,15 @@ template<> _LIBCPP_FUNC_VIS void moneypunct_byname::init(const char*); template<> _LIBCPP_FUNC_VIS void moneypunct_byname::init(const char*); -template<> _LIBCPP_FUNC_VIS void moneypunct_byname::init(const char*); -template<> _LIBCPP_FUNC_VIS void moneypunct_byname::init(const char*); - _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname) _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname) + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +template<> _LIBCPP_FUNC_VIS void moneypunct_byname::init(const char*); +template<> _LIBCPP_FUNC_VIS void moneypunct_byname::init(const char*); _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname) _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname) +#endif // money_get @@ -2797,7 +2819,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get) +#endif template > class _LIBCPP_TEMPLATE_VIS money_get @@ -3184,7 +3208,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get) +#endif // money_put @@ -3359,7 +3385,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put) +#endif template > class _LIBCPP_TEMPLATE_VIS money_put @@ -3512,7 +3540,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put) +#endif // messages @@ -3628,7 +3658,9 @@ } _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages) +#endif template class _LIBCPP_TEMPLATE_VIS messages_byname @@ -3652,7 +3684,9 @@ }; _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname) +#endif template, diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap --- a/libcxx/include/module.modulemap +++ b/libcxx/include/module.modulemap @@ -869,6 +869,7 @@ module __function_like { private header "__function_like.h" export * } module __hash_table { header "__hash_table" export * } module __locale { private header "__locale" export * } + module __mbstate { private header "__mbstate_t.h" export * } module __mutex_base { private header "__mutex_base" export * } module __node_handle { private header "__node_handle" export * } module __nullptr { header "__nullptr" export * } diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -1087,7 +1087,9 @@ } _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream) +#endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -1072,32 +1072,38 @@ template string_type __transform_primary(_ForwardIterator __f, _ForwardIterator __l, char) const; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template string_type __transform_primary(_ForwardIterator __f, _ForwardIterator __l, wchar_t) const; - +#endif template string_type __lookup_collatename(_ForwardIterator __f, _ForwardIterator __l, char) const; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template string_type __lookup_collatename(_ForwardIterator __f, _ForwardIterator __l, wchar_t) const; - +#endif template char_class_type __lookup_classname(_ForwardIterator __f, _ForwardIterator __l, bool __icase, char) const; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template char_class_type __lookup_classname(_ForwardIterator __f, _ForwardIterator __l, bool __icase, wchar_t) const; +#endif static int __regex_traits_value(unsigned char __ch, int __radix); _LIBCPP_INLINE_VISIBILITY int __regex_traits_value(char __ch, int __radix) const {return __regex_traits_value(static_cast(__ch), __radix);} +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_INLINE_VISIBILITY int __regex_traits_value(wchar_t __ch, int __radix) const; +#endif }; template @@ -1168,6 +1174,7 @@ return __d; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template template typename regex_traits<_CharT>::string_type @@ -1189,6 +1196,7 @@ } return __d; } +#endif // lookup_collatename is very FreeBSD-specific @@ -1217,6 +1225,7 @@ return __r; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template template typename regex_traits<_CharT>::string_type @@ -1250,6 +1259,7 @@ } return __r; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // lookup_classname @@ -1268,6 +1278,7 @@ return __get_classname(__s.c_str(), __icase); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template template typename regex_traits<_CharT>::char_class_type @@ -1288,6 +1299,7 @@ } return __get_classname(__n.c_str(), __icase); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template bool @@ -1318,6 +1330,7 @@ return -1; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template inline int @@ -1325,6 +1338,7 @@ { return __regex_traits_value(static_cast(__ct_->narrow(__ch, char_type())), __radix); } +#endif template class __node; @@ -2135,7 +2149,9 @@ }; template <> _LIBCPP_FUNC_VIS void __match_any_but_newline::__exec(__state&) const; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> _LIBCPP_FUNC_VIS void __match_any_but_newline::__exec(__state&) const; +#endif // __match_char @@ -2542,13 +2558,15 @@ class _LIBCPP_TEMPLATE_VIS basic_regex; typedef basic_regex regex; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef basic_regex wregex; +#endif template class _LIBCPP_TEMPLATE_VIS _LIBCPP_PREFERRED_NAME(regex) - _LIBCPP_PREFERRED_NAME(wregex) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wregex)) basic_regex { public: @@ -4897,17 +4915,19 @@ // sub_match typedef sub_match csub_match; -typedef sub_match wcsub_match; typedef sub_match ssub_match; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +typedef sub_match wcsub_match; typedef sub_match wssub_match; +#endif template class _LIBCPP_TEMPLATE_VIS _LIBCPP_PREFERRED_NAME(csub_match) - _LIBCPP_PREFERRED_NAME(wcsub_match) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcsub_match)) _LIBCPP_PREFERRED_NAME(ssub_match) - _LIBCPP_PREFERRED_NAME(wssub_match) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wssub_match)) sub_match : public pair<_BidirectionalIterator, _BidirectionalIterator> { @@ -5326,17 +5346,19 @@ } typedef match_results cmatch; -typedef match_results wcmatch; typedef match_results smatch; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +typedef match_results wcmatch; typedef match_results wsmatch; +#endif template class _LIBCPP_TEMPLATE_VIS _LIBCPP_PREFERRED_NAME(cmatch) - _LIBCPP_PREFERRED_NAME(wcmatch) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcmatch)) _LIBCPP_PREFERRED_NAME(smatch) - _LIBCPP_PREFERRED_NAME(wsmatch) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsmatch)) match_results { public: @@ -6244,17 +6266,19 @@ class _LIBCPP_TEMPLATE_VIS regex_iterator; typedef regex_iterator cregex_iterator; -typedef regex_iterator wcregex_iterator; typedef regex_iterator sregex_iterator; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +typedef regex_iterator wcregex_iterator; typedef regex_iterator wsregex_iterator; +#endif template class _LIBCPP_TEMPLATE_VIS _LIBCPP_PREFERRED_NAME(cregex_iterator) - _LIBCPP_PREFERRED_NAME(wcregex_iterator) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcregex_iterator)) _LIBCPP_PREFERRED_NAME(sregex_iterator) - _LIBCPP_PREFERRED_NAME(wsregex_iterator) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_iterator)) regex_iterator { public: @@ -6372,17 +6396,19 @@ class _LIBCPP_TEMPLATE_VIS regex_token_iterator; typedef regex_token_iterator cregex_token_iterator; -typedef regex_token_iterator wcregex_token_iterator; typedef regex_token_iterator sregex_token_iterator; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +typedef regex_token_iterator wcregex_token_iterator; typedef regex_token_iterator wsregex_token_iterator; +#endif template class _LIBCPP_TEMPLATE_VIS _LIBCPP_PREFERRED_NAME(cregex_token_iterator) - _LIBCPP_PREFERRED_NAME(wcregex_token_iterator) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcregex_token_iterator)) _LIBCPP_PREFERRED_NAME(sregex_token_iterator) - _LIBCPP_PREFERRED_NAME(wsregex_token_iterator) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_token_iterator)) regex_token_iterator { public: diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -524,7 +524,6 @@ #include // EOF #include #include -#include #include #include #include @@ -535,6 +534,10 @@ #include #include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif + #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS # include #endif @@ -1729,11 +1732,15 @@ // These declarations must appear before any functions are implicitly used // so that they have the correct visibility specifier. #ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION -_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char) -_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t) + _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char) +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t) +# endif #else -_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char) -_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t) + _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char) +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t) +# endif #endif @@ -4395,6 +4402,7 @@ _LIBCPP_FUNC_VIS string to_string(double __val); _LIBCPP_FUNC_VIS string to_string(long double __val); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = nullptr, int __base = 10); _LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = nullptr, int __base = 10); _LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10); @@ -4414,6 +4422,7 @@ _LIBCPP_FUNC_VIS wstring to_wstring(float __val); _LIBCPP_FUNC_VIS wstring to_wstring(double __val); _LIBCPP_FUNC_VIS wstring to_wstring(long double __val); +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template _LIBCPP_TEMPLATE_DATA_VIS @@ -4535,11 +4544,13 @@ return basic_string (__str, __len); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY basic_string operator "" s( const wchar_t *__str, size_t __len ) { return basic_string (__str, __len); } +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T inline _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -225,7 +225,9 @@ #endif typedef basic_string_view u16string_view; typedef basic_string_view u32string_view; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef basic_string_view wstring_view; +#endif template class @@ -235,7 +237,7 @@ #endif _LIBCPP_PREFERRED_NAME(u16string_view) _LIBCPP_PREFERRED_NAME(u32string_view) - _LIBCPP_PREFERRED_NAME(wstring_view) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstring_view)) basic_string_view { public: // types @@ -885,11 +887,13 @@ return basic_string_view (__str, __len); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR basic_string_view operator "" sv(const wchar_t *__str, size_t __len) _NOEXCEPT { return basic_string_view (__str, __len); } +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR diff --git a/libcxx/include/wchar.h b/libcxx/include/wchar.h --- a/libcxx/include/wchar.h +++ b/libcxx/include/wchar.h @@ -108,6 +108,10 @@ #include <__config> #include +#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# error "The header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled" +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/wctype.h b/libcxx/include/wctype.h --- a/libcxx/include/wctype.h +++ b/libcxx/include/wctype.h @@ -46,6 +46,10 @@ #include <__config> +#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# error "The header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled" +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/src/algorithm.cpp b/libcxx/src/algorithm.cpp --- a/libcxx/src/algorithm.cpp +++ b/libcxx/src/algorithm.cpp @@ -11,7 +11,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD template void __sort<__less&, char*>(char*, char*, __less&); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&); +#endif template void __sort<__less&, signed char*>(signed char*, signed char*, __less&); template void __sort<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&); template void __sort<__less&, short*>(short*, short*, __less&); @@ -27,7 +29,9 @@ template void __sort<__less&, long double*>(long double*, long double*, __less&); template bool __insertion_sort_incomplete<__less&, char*>(char*, char*, __less&); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template bool __insertion_sort_incomplete<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&); +#endif template bool __insertion_sort_incomplete<__less&, signed char*>(signed char*, signed char*, __less&); template bool __insertion_sort_incomplete<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&); template bool __insertion_sort_incomplete<__less&, short*>(short*, short*, __less&); diff --git a/libcxx/src/ios.instantiations.cpp b/libcxx/src/ios.instantiations.cpp --- a/libcxx/src/ios.instantiations.cpp +++ b/libcxx/src/ios.instantiations.cpp @@ -19,15 +19,18 @@ // Original explicit instantiations provided in the library template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios; template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf; template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream; template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream; template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios; +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf; +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream; +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream; +#endif + // Additional instantiations added later. Whether programs rely on these being // available is protected by _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1. template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringbuf; diff --git a/libcxx/src/iostream.cpp b/libcxx/src/iostream.cpp --- a/libcxx/src/iostream.cpp +++ b/libcxx/src/iostream.cpp @@ -24,6 +24,8 @@ ; _ALIGNAS_TYPE (__stdinbuf ) static char __cin[sizeof(__stdinbuf )]; static mbstate_t mb_cin; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin[sizeof(wistream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wcin@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_istream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A") @@ -31,6 +33,7 @@ ; _ALIGNAS_TYPE (__stdinbuf ) static char __wcin[sizeof(__stdinbuf )]; static mbstate_t mb_wcin; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) @@ -39,6 +42,8 @@ ; _ALIGNAS_TYPE (__stdoutbuf) static char __cout[sizeof(__stdoutbuf)]; static mbstate_t mb_cout; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wcout@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A") @@ -46,6 +51,7 @@ ; _ALIGNAS_TYPE (__stdoutbuf) static char __wcout[sizeof(__stdoutbuf)]; static mbstate_t mb_wcout; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) @@ -54,6 +60,8 @@ ; _ALIGNAS_TYPE (__stdoutbuf) static char __cerr[sizeof(__stdoutbuf)]; static mbstate_t mb_cerr; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wcerr@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A") @@ -61,17 +69,21 @@ ; _ALIGNAS_TYPE (__stdoutbuf) static char __wcerr[sizeof(__stdoutbuf)]; static mbstate_t mb_wcerr; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?clog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A") #endif ; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wclog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A") #endif ; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // Hacky way to make the compiler believe that we're inside a system header so // it doesn't flag the use of the init_priority attribute with a value that's @@ -109,33 +121,38 @@ force_locale_initialization(); istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf (stdin, &mb_cin)); - wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf (stdin, &mb_wcin)); ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf(stdout, &mb_cout)); - wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf(stdout, &mb_wcout)); ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf(stderr, &mb_cerr)); ::new(clog) ostream(cerr_ptr->rdbuf()); + cin_ptr->tie(cout_ptr); + _VSTD::unitbuf(*cerr_ptr); + cerr_ptr->tie(cout_ptr); + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf (stdin, &mb_wcin)); + wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf(stdout, &mb_wcout)); wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf(stderr, &mb_wcerr)); ::new(wclog) wostream(wcerr_ptr->rdbuf()); - cin_ptr->tie(cout_ptr); wcin_ptr->tie(wcout_ptr); - _VSTD::unitbuf(*cerr_ptr); _VSTD::unitbuf(*wcerr_ptr); - cerr_ptr->tie(cout_ptr); wcerr_ptr->tie(wcout_ptr); +#endif } DoIOSInit::~DoIOSInit() { ostream* cout_ptr = reinterpret_cast(cout); - wostream* wcout_ptr = reinterpret_cast(wcout); cout_ptr->flush(); - wcout_ptr->flush(); - ostream* clog_ptr = reinterpret_cast(clog); - wostream* wclog_ptr = reinterpret_cast(wclog); clog_ptr->flush(); + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + wostream* wcout_ptr = reinterpret_cast(wcout); + wcout_ptr->flush(); + wostream* wclog_ptr = reinterpret_cast(wclog); wclog_ptr->flush(); +#endif } ios_base::Init::Init() diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -18,13 +18,16 @@ #include "cstdio" #include "cstdlib" #include "cstring" -#include "cwctype" #include "locale" #include "string" #include "type_traits" #include "typeinfo" #include "vector" +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include "cwctype" +#endif + #if defined(_LIBCPP_MSVCRT) # define _CTYPE_DISABLE_MACROS #endif @@ -176,11 +179,17 @@ { facets_.clear(); install(&make<_VSTD::collate >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make<_VSTD::collate >(1u)); +#endif install(&make<_VSTD::ctype >(nullptr, false, 1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make<_VSTD::ctype >(1u)); +#endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif _LIBCPP_SUPPRESS_DEPRECATED_PUSH install(&make >(1u)); install(&make >(1u)); @@ -190,25 +199,43 @@ install(&make >(1u)); #endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif install(&make >(1u)); install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); install(&make >(1u)); +#endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif install(&make >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make >(1u)); +#endif install(&make<_VSTD::messages >(1u)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(&make<_VSTD::messages >(1u)); +#endif } locale::__imp::__imp(const string& name, size_t refs) @@ -225,11 +252,17 @@ if (facets_[i]) facets_[i]->__add_shared(); install(new collate_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new collate_byname(name_)); +#endif install(new ctype_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new ctype_byname(name_)); +#endif install(new codecvt_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new codecvt_byname(name_)); +#endif _LIBCPP_SUPPRESS_DEPRECATED_PUSH install(new codecvt_byname(name_)); install(new codecvt_byname(name_)); @@ -239,17 +272,27 @@ install(new codecvt_byname(name_)); #endif install(new numpunct_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new numpunct_byname(name_)); +#endif install(new moneypunct_byname(name_)); install(new moneypunct_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new moneypunct_byname(name_)); install(new moneypunct_byname(name_)); +#endif install(new time_get_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new time_get_byname(name_)); +#endif install(new time_put_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new time_put_byname(name_)); +#endif install(new messages_byname(name_)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new messages_byname(name_)); +#endif #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) @@ -287,14 +330,20 @@ if (c & locale::collate) { install(new collate_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new collate_byname(name)); +#endif } if (c & locale::ctype) { install(new ctype_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new ctype_byname(name)); +#endif install(new codecvt_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new codecvt_byname(name)); +#endif _LIBCPP_SUPPRESS_DEPRECATED_PUSH install(new codecvt_byname(name)); install(new codecvt_byname(name)); @@ -308,25 +357,35 @@ { install(new moneypunct_byname(name)); install(new moneypunct_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new moneypunct_byname(name)); install(new moneypunct_byname(name)); +#endif } if (c & locale::numeric) { install(new numpunct_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new numpunct_byname(name)); +#endif } if (c & locale::time) { install(new time_get_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new time_get_byname(name)); +#endif install(new time_put_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new time_put_byname(name)); +#endif } if (c & locale::messages) { install(new messages_byname(name)); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install(new messages_byname(name)); +#endif } #ifndef _LIBCPP_NO_EXCEPTIONS } @@ -364,12 +423,16 @@ if (c & locale::collate) { install_from<_VSTD::collate >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from<_VSTD::collate >(one); +#endif } if (c & locale::ctype) { install_from<_VSTD::ctype >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from<_VSTD::ctype >(one); +#endif install_from<_VSTD::codecvt >(one); _LIBCPP_SUPPRESS_DEPRECATED_PUSH install_from<_VSTD::codecvt >(one); @@ -379,39 +442,59 @@ install_from<_VSTD::codecvt >(one); install_from<_VSTD::codecvt >(one); #endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from<_VSTD::codecvt >(one); +#endif } if (c & locale::monetary) { install_from >(one); install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); install_from >(one); +#endif install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); +#endif install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); +#endif } if (c & locale::numeric) { install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); +#endif install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); +#endif install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); +#endif } if (c & locale::time) { install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); +#endif install_from >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from >(one); +#endif } if (c & locale::messages) { install_from<_VSTD::messages >(one); +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS install_from<_VSTD::messages >(one); +#endif } #ifndef _LIBCPP_NO_EXCEPTIONS } @@ -702,6 +785,7 @@ // template <> class collate_byname +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS collate_byname::collate_byname(const char* n, size_t refs) : collate(refs), __l(newlocale(LC_ALL_MASK, n, 0)) @@ -747,6 +831,7 @@ wcsxfrm_l(const_cast(out.c_str()), in.c_str(), out.size()+1, __l); return out; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS const ctype_base::mask ctype_base::space; const ctype_base::mask ctype_base::print; @@ -763,6 +848,7 @@ // template <> class ctype; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS locale::id ctype::id; ctype::~ctype() @@ -892,6 +978,7 @@ *dest = dfault; return low; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // template <> class ctype; @@ -1223,6 +1310,7 @@ // template <> class ctype_byname +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ctype_byname::ctype_byname(const char* name, size_t refs) : ctype(refs), __l(newlocale(LC_ALL_MASK, name, 0)) @@ -1422,6 +1510,7 @@ } return low; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // template <> class codecvt @@ -1486,6 +1575,7 @@ // template <> class codecvt +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS locale::id codecvt::id; codecvt::codecvt(size_t refs) @@ -1698,6 +1788,7 @@ { return __l == 0 ? 1 : static_cast(__libcpp_mb_cur_max_l(__l)); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // Valid UTF ranges // UTF-32 UTF-16 UTF-8 # of code points @@ -3404,6 +3495,7 @@ // __codecvt_utf8 +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS __codecvt_utf8::result __codecvt_utf8::do_out(state_type&, const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, @@ -3505,6 +3597,7 @@ return 4; #endif } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // __codecvt_utf8 @@ -3658,6 +3751,7 @@ // __codecvt_utf16 +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS __codecvt_utf16::result __codecvt_utf16::do_out(state_type&, const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, @@ -3863,6 +3957,7 @@ return 4; #endif } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // __codecvt_utf16 @@ -4166,6 +4261,7 @@ // __codecvt_utf8_utf16 +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS __codecvt_utf8_utf16::result __codecvt_utf8_utf16::do_out(state_type&, const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, @@ -4250,6 +4346,7 @@ return 7; return 4; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // __codecvt_utf8_utf16 @@ -4425,7 +4522,7 @@ { } - +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS static bool checked_string_to_wchar_convert(wchar_t& dest, const char* ptr, locale_t loc) { @@ -4440,6 +4537,7 @@ dest = out; return true; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS static bool checked_string_to_char_convert(char& dest, const char* ptr, @@ -4450,6 +4548,8 @@ dest = *ptr; return true; } + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS // First convert the MBS into a wide char then attempt to narrow it using // wctob_l. wchar_t wout; @@ -4470,6 +4570,9 @@ default: return false; } +#else // _LIBCPP_HAS_NO_WIDE_CHARACTERS + return false; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_UNREACHABLE(); } @@ -4477,7 +4580,9 @@ // numpunct && numpunct locale::id numpunct< char >::id; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS locale::id numpunct::id; +#endif numpunct::numpunct(size_t refs) : locale::facet(refs), @@ -4486,35 +4591,49 @@ { } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS numpunct::numpunct(size_t refs) : locale::facet(refs), __decimal_point_(L'.'), __thousands_sep_(L',') { } +#endif numpunct::~numpunct() { } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS numpunct::~numpunct() { } +#endif char numpunct< char >::do_decimal_point() const {return __decimal_point_;} +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS wchar_t numpunct::do_decimal_point() const {return __decimal_point_;} +#endif char numpunct< char >::do_thousands_sep() const {return __thousands_sep_;} +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS wchar_t numpunct::do_thousands_sep() const {return __thousands_sep_;} +#endif string numpunct< char >::do_grouping() const {return __grouping_;} +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS string numpunct::do_grouping() const {return __grouping_;} +#endif string numpunct< char >::do_truename() const {return "true";} +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS wstring numpunct::do_truename() const {return L"true";} +#endif string numpunct< char >::do_falsename() const {return "false";} +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS wstring numpunct::do_falsename() const {return L"false";} +#endif // numpunct_byname @@ -4537,6 +4656,7 @@ void numpunct_byname::__init(const char* nm) { + typedef numpunct base; if (strcmp(nm, "C") != 0) { __libcpp_unique_locale loc(nm); @@ -4545,10 +4665,12 @@ " failed to construct for " + string(nm)); lconv* lc = __libcpp_localeconv_l(loc.get()); - checked_string_to_char_convert(__decimal_point_, lc->decimal_point, - loc.get()); - checked_string_to_char_convert(__thousands_sep_, lc->thousands_sep, - loc.get()); + if (!checked_string_to_char_convert(__decimal_point_, lc->decimal_point, + loc.get())) + __decimal_point_ = base::do_decimal_point(); + if (!checked_string_to_char_convert(__thousands_sep_, lc->thousands_sep, + loc.get())) + __thousands_sep_ = base::do_thousands_sep(); __grouping_ = lc->grouping; // localization for truename and falsename is not available } @@ -4556,6 +4678,7 @@ // numpunct_byname +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS numpunct_byname::numpunct_byname(const char* nm, size_t refs) : numpunct(refs) { @@ -4591,6 +4714,7 @@ // localization for truename and falsename is not available } } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // num_get helpers @@ -4766,6 +4890,7 @@ return weeks; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS static wstring* init_wweeks() @@ -4787,6 +4912,7 @@ weeks[13] = L"Sat"; return weeks; } +#endif template <> const string* @@ -4796,6 +4922,7 @@ return weeks; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> const wstring* __time_get_c_storage::__weeks() const @@ -4803,6 +4930,7 @@ static const wstring* weeks = init_wweeks(); return weeks; } +#endif static string* @@ -4836,6 +4964,7 @@ return months; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS static wstring* init_wmonths() @@ -4867,6 +4996,7 @@ months[23] = L"Dec"; return months; } +#endif template <> const string* @@ -4876,6 +5006,7 @@ return months; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> const wstring* __time_get_c_storage::__months() const @@ -4883,6 +5014,7 @@ static const wstring* months = init_wmonths(); return months; } +#endif static string* @@ -4894,6 +5026,7 @@ return am_pm; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS static wstring* init_wam_pm() @@ -4903,6 +5036,7 @@ am_pm[1] = L"PM"; return am_pm; } +#endif template <> const string* @@ -4912,6 +5046,7 @@ return am_pm; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> const wstring* __time_get_c_storage::__am_pm() const @@ -4919,6 +5054,7 @@ static const wstring* am_pm = init_wam_pm(); return am_pm; } +#endif template <> const string& @@ -4928,6 +5064,7 @@ return s; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> const wstring& __time_get_c_storage::__x() const @@ -4935,6 +5072,7 @@ static wstring s(L"%m/%d/%y"); return s; } +#endif template <> const string& @@ -4944,6 +5082,7 @@ return s; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> const wstring& __time_get_c_storage::__X() const @@ -4951,6 +5090,7 @@ static wstring s(L"%H:%M:%S"); return s; } +#endif template <> const string& @@ -4960,6 +5100,7 @@ return s; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> const wstring& __time_get_c_storage::__c() const @@ -4967,6 +5108,7 @@ static wstring s(L"%a %b %d %H:%M:%S %Y"); return s; } +#endif template <> const string& @@ -4976,6 +5118,7 @@ return s; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> const wstring& __time_get_c_storage::__r() const @@ -4983,6 +5126,7 @@ static wstring s(L"%I:%M:%S %p"); return s; } +#endif // time_get_byname @@ -5161,6 +5305,7 @@ #pragma clang diagnostic ignored "-Wmissing-braces" #endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> wstring __time_get_storage::__analyze(char fmt, const ctype& ct) @@ -5310,6 +5455,7 @@ } return result; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> void @@ -5348,6 +5494,7 @@ __X_ = __analyze('X', ct); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> void __time_get_storage::init(const ctype& ct) @@ -5423,6 +5570,7 @@ __x_ = __analyze('x', ct); __X_ = __analyze('X', ct); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template struct _LIBCPP_HIDDEN __time_get_temp @@ -5450,6 +5598,7 @@ init(ct); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> __time_get_storage::__time_get_storage(const char* __nm) : __time_get(__nm) @@ -5465,6 +5614,7 @@ const __time_get_temp ct(__nm); init(ct); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> time_base::dateorder @@ -5553,6 +5703,7 @@ return time_base::no_order; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> time_base::dateorder __time_get_storage::__do_date_order() const @@ -5639,6 +5790,7 @@ } return time_base::no_order; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // time_put @@ -5675,6 +5827,7 @@ __ne = __nb + n; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS void __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm, char __fmt, char __mod) const @@ -5689,6 +5842,7 @@ __throw_runtime_error("locale not supported"); __we = __wb + j; } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // moneypunct_byname @@ -6168,6 +6322,7 @@ #endif // !_LIBCPP_MSVCRT } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template<> void moneypunct_byname::init(const char* nm) @@ -6315,6 +6470,7 @@ lc->int_n_sign_posn, L' '); #endif // !_LIBCPP_MSVCRT } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS void __do_nothing(void*) {} @@ -6328,63 +6484,63 @@ #endif } -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get;) -template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get; -template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get; + template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get; +_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put;) -template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put; -template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put; + template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put; +_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct;) +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname;) +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; + template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname;) template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; #ifndef _LIBCPP_HAS_NO_CHAR8_T diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp --- a/libcxx/src/string.cpp +++ b/libcxx/src/string.cpp @@ -9,13 +9,16 @@ #include "string" #include "charconv" #include "cstdlib" -#include "cwchar" #include "cerrno" #include "limits" #include "stdexcept" #include #include "__debug" +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include "cwchar" +#endif + _LIBCPP_BEGIN_NAMESPACE_STD void __basic_string_common::__throw_length_error() const { @@ -28,11 +31,15 @@ #define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template __VA_ARGS__; #ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION -_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char) -_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t) + _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char) +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t) +# endif #else -_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char) -_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t) + _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char) +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t) +# endif #endif #undef _LIBCPP_EXTERN_TEMPLATE_DEFINE @@ -137,6 +144,7 @@ return as_integer_helper( func, s, idx, base, strtoull ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS // wstring template<> inline @@ -181,6 +189,7 @@ { return as_integer_helper( func, s, idx, base, wcstoull ); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // as_float @@ -232,6 +241,7 @@ return as_float_helper( func, s, idx, strtold ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template<> inline float @@ -255,6 +265,7 @@ { return as_float_helper( func, s, idx, wcstold ); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS } // unnamed namespace @@ -264,11 +275,13 @@ return as_integer( "stoi", str, idx, base ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS int stoi(const wstring& str, size_t* idx, int base) { return as_integer( "stoi", str, idx, base ); } +#endif long stol(const string& str, size_t* idx, int base) @@ -276,11 +289,13 @@ return as_integer( "stol", str, idx, base ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS long stol(const wstring& str, size_t* idx, int base) { return as_integer( "stol", str, idx, base ); } +#endif unsigned long stoul(const string& str, size_t* idx, int base) @@ -288,11 +303,13 @@ return as_integer( "stoul", str, idx, base ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS unsigned long stoul(const wstring& str, size_t* idx, int base) { return as_integer( "stoul", str, idx, base ); } +#endif long long stoll(const string& str, size_t* idx, int base) @@ -300,11 +317,13 @@ return as_integer( "stoll", str, idx, base ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS long long stoll(const wstring& str, size_t* idx, int base) { return as_integer( "stoll", str, idx, base ); } +#endif unsigned long long stoull(const string& str, size_t* idx, int base) @@ -312,11 +331,13 @@ return as_integer( "stoull", str, idx, base ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS unsigned long long stoull(const wstring& str, size_t* idx, int base) { return as_integer( "stoull", str, idx, base ); } +#endif float stof(const string& str, size_t* idx) @@ -324,11 +345,13 @@ return as_float( "stof", str, idx ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS float stof(const wstring& str, size_t* idx) { return as_float( "stof", str, idx ); } +#endif double stod(const string& str, size_t* idx) @@ -336,11 +359,13 @@ return as_float( "stod", str, idx ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS double stod(const wstring& str, size_t* idx) { return as_float( "stod", str, idx ); } +#endif long double stold(const string& str, size_t* idx) @@ -348,11 +373,13 @@ return as_float( "stold", str, idx ); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS long double stold(const wstring& str, size_t* idx) { return as_float( "stold", str, idx ); } +#endif // to_string @@ -403,6 +430,7 @@ } }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> struct initial_string { @@ -427,6 +455,7 @@ return static_cast(_snwprintf); #endif } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template S i_to_string(V v) @@ -450,20 +479,23 @@ string to_string (unsigned long val) { return i_to_string< string>(val); } string to_string (unsigned long long val) { return i_to_string< string>(val); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS wstring to_wstring(int val) { return i_to_string(val); } wstring to_wstring(long val) { return i_to_string(val); } wstring to_wstring(long long val) { return i_to_string(val); } wstring to_wstring(unsigned val) { return i_to_string(val); } wstring to_wstring(unsigned long val) { return i_to_string(val); } wstring to_wstring(unsigned long long val) { return i_to_string(val); } - +#endif string to_string (float val) { return as_string(snprintf, initial_string< string>()(), "%f", val); } string to_string (double val) { return as_string(snprintf, initial_string< string>()(), "%f", val); } string to_string (long double val) { return as_string(snprintf, initial_string< string>()(), "%Lf", val); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS wstring to_wstring(float val) { return as_string(get_swprintf(), initial_string()(), L"%f", val); } wstring to_wstring(double val) { return as_string(get_swprintf(), initial_string()(), L"%f", val); } wstring to_wstring(long double val) { return as_string(get_swprintf(), initial_string()(), L"%Lf", val); } +#endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp b/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp --- a/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp +++ b/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp @@ -65,7 +65,9 @@ CHECK_ALIGNMENT(unsigned char); CHECK_ALIGNMENT(char16_t); CHECK_ALIGNMENT(char32_t); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS CHECK_ALIGNMENT(wchar_t); +#endif CHECK_ALIGNMENT(short); CHECK_ALIGNMENT(unsigned short); CHECK_ALIGNMENT(int); diff --git a/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp b/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp --- a/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp +++ b/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp @@ -39,8 +39,10 @@ // tgmath.h is not supported in extern "C". #include // FIXME: #include -#include -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +# include +#endif } int main(int, char**) { diff --git a/libcxx/test/std/re/re.syn/wregex.pass.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/mbstate_t.h.module.verify.cpp copy from libcxx/test/std/re/re.syn/wregex.pass.cpp copy to libcxx/test/libcxx/diagnostics/detail.headers/mbstate_t.h.module.verify.cpp --- a/libcxx/test/std/re/re.syn/wregex.pass.cpp +++ b/libcxx/test/libcxx/diagnostics/detail.headers/mbstate_t.h.module.verify.cpp @@ -6,17 +6,10 @@ // //===----------------------------------------------------------------------===// -// +// REQUIRES: modules-build -// typedef basic_regex wregex; +// WARNING: This test was generated by 'generate_private_header_tests.py' +// and should not be edited manually. -#include -#include -#include "test_macros.h" - -int main(int, char**) -{ - static_assert((std::is_same, std::wregex>::value), ""); - - return 0; -} +// expected-error@*:* {{use of private header from outside its module: '__mbstate_t.h'}} +#include <__mbstate_t.h> diff --git a/libcxx/test/libcxx/double_include.sh.cpp b/libcxx/test/libcxx/double_include.sh.cpp --- a/libcxx/test/libcxx/double_include.sh.cpp +++ b/libcxx/test/libcxx/double_include.sh.cpp @@ -74,8 +74,12 @@ #include #include #include -#include -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif #include #include #include @@ -191,8 +195,12 @@ #include #include #include -#include -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif // experimental headers #if __cplusplus >= 201103L diff --git a/libcxx/test/libcxx/include_as_c.sh.cpp b/libcxx/test/libcxx/include_as_c.sh.cpp --- a/libcxx/test/libcxx/include_as_c.sh.cpp +++ b/libcxx/test/libcxx/include_as_c.sh.cpp @@ -45,8 +45,10 @@ #ifndef _MSC_VER # include #endif -#include -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +# include +#endif int main(int argc, char **argv) { (void)argc; diff --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp --- a/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp +++ b/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp @@ -146,7 +146,9 @@ { auto const& S = shortString; doShortStringTest(S); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS doShortStringTest(S); +#endif doShortStringTest(S); doShortStringTest(S); #if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t) @@ -156,7 +158,9 @@ { auto const& S = longString; doLongStringTest(S); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS doLongStringTest(S); +#endif doLongStringTest(S); doLongStringTest(S); #if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t) diff --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp --- a/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp +++ b/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp @@ -97,7 +97,9 @@ int main(int, char**) { MakeTestType::Test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS MakeTestType::Test(); +#endif MakeTestType::Test(); MakeTestType::Test(); diff --git a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp --- a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp +++ b/libcxx/test/libcxx/input.output/iostream.format/input.streams/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: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp --- a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp +++ b/libcxx/test/libcxx/input.output/iostream.format/output.streams/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: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp --- a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp +++ b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp @@ -14,6 +14,8 @@ // // The char type of the stream and the char_type of the traits have to match +// UNSUPPORTED: libcpp-has-no-wide-characters + #include int main(int, char**) diff --git a/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp b/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp --- a/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp +++ b/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp @@ -225,10 +225,12 @@ static_assert(( std::__is_cpp17_contiguous_iterator ::value), ""); static_assert((!std::__is_cpp17_contiguous_iterator ::value), ""); static_assert((!std::__is_cpp17_contiguous_iterator::value), ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(( std::__is_cpp17_contiguous_iterator ::value), ""); static_assert(( std::__is_cpp17_contiguous_iterator ::value), ""); static_assert((!std::__is_cpp17_contiguous_iterator ::value), ""); static_assert((!std::__is_cpp17_contiguous_iterator::value), ""); +#endif // deque is random-access but not contiguous static_assert((!std::__is_cpp17_contiguous_iterator::iterator> ::value), ""); diff --git a/libcxx/test/libcxx/iterators/failed.pass.cpp b/libcxx/test/libcxx/iterators/failed.pass.cpp --- a/libcxx/test/libcxx/iterators/failed.pass.cpp +++ b/libcxx/test/libcxx/iterators/failed.pass.cpp @@ -25,10 +25,12 @@ std::ostreambuf_iterator i(nullptr); assert(i.failed()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::ostreambuf_iterator i(nullptr); assert(i.failed()); } +#endif return 0; } diff --git a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp --- a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp +++ b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp @@ -25,7 +25,9 @@ static_assert(std::__integer_like); static_assert(std::__integer_like); static_assert(std::__integer_like); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(std::__integer_like); +#endif static_assert(std::__integer_like); static_assert(std::__integer_like); static_assert(std::__integer_like); @@ -42,7 +44,9 @@ static_assert(!std::__signed_integer_like); static_assert(!std::__signed_integer_like); static_assert(std::__signed_integer_like == std::signed_integral); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(std::__signed_integer_like == std::signed_integral); +#endif static_assert(std::__signed_integer_like == std::signed_integral); static_assert(std::__signed_integer_like == std::signed_integral); static_assert(std::__signed_integer_like == std::signed_integral); diff --git a/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp --- a/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp +++ b/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp @@ -9,6 +9,8 @@ // 'do_bytes' throws a std::range_error unexpectedly // XFAIL: LIBCXX-WINDOWS-FIXME, powerpc-ibm-aix +// XFAIL: libcpp-has-no-wide-characters + // UNSUPPORTED: c++03 // diff --git a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp --- a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp +++ b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp @@ -112,10 +112,14 @@ TEST_MACROS(); #include TEST_MACROS(); -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include TEST_MACROS(); -#include +#endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include TEST_MACROS(); +#endif #include TEST_MACROS(); #include @@ -304,10 +308,14 @@ TEST_MACROS(); #include TEST_MACROS(); -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include TEST_MACROS(); -#include +#endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include TEST_MACROS(); +#endif // experimental headers #if __cplusplus >= 201103L diff --git a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp --- a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp +++ b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp @@ -69,8 +69,12 @@ #include #include #include -#include -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif #include #include #include @@ -186,8 +190,12 @@ #include #include #include -#include -#include +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif // experimental headers #if __cplusplus >= 201103L diff --git a/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp b/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp --- a/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp +++ b/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // #include diff --git a/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp b/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp --- a/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp +++ b/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // #include diff --git a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp --- a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp +++ b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp @@ -87,7 +87,9 @@ check_integral_types(); check_integral_types(); check_integral_types(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS check_integral_types(); +#endif check_integral_types(); // On some platforms, unsigned int and long are the same size. These // platforms have a choice of making uint32_t an int or a long. However diff --git a/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp b/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp @@ -350,7 +350,9 @@ void test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif } int main(int, char**) { diff --git a/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp b/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp @@ -304,7 +304,9 @@ void test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif } int main(int, char**) { diff --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp @@ -430,7 +430,9 @@ constexpr bool test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return true; } @@ -440,10 +442,12 @@ // Make sure the parsers match the expectations. The layout of the // subobjects is chosen to minimize the size required. static_assert(sizeof(Parser) == 2 * sizeof(uint32_t)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert( sizeof(Parser) == (sizeof(wchar_t) <= 2 ? 2 * sizeof(uint32_t) : 3 * sizeof(uint32_t))); #endif +#endif // _WIN32 test(); static_assert(test()); diff --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp @@ -428,7 +428,9 @@ constexpr bool test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return true; } @@ -440,10 +442,12 @@ // Make sure the parsers match the expectations. The layout of the // subobjects is chosen to minimize the size required. static_assert(sizeof(Parser) == 2 * sizeof(uint32_t)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert( sizeof(Parser) == (sizeof(wchar_t) <= 2 ? 2 * sizeof(uint32_t) : 3 * sizeof(uint32_t))); #endif +#endif // _WIN32 test(); static_assert(test()); diff --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp @@ -323,7 +323,9 @@ constexpr bool test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return true; } @@ -333,10 +335,12 @@ // Make sure the parsers match the expectations. The layout of the // subobjects is chosen to minimize the size required. static_assert(sizeof(Parser) == 2 * sizeof(uint32_t)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert( sizeof(Parser) == (sizeof(wchar_t) <= 2 ? 2 * sizeof(uint32_t) : 3 * sizeof(uint32_t))); #endif +#endif // _WIN32 test(); static_assert(test()); diff --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp @@ -351,7 +351,9 @@ constexpr bool test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test(); #endif @@ -368,10 +370,12 @@ // Make sure the parsers match the expectations. The layout of the // subobjects is chosen to minimize the size required. LIBCPP_STATIC_ASSERT(sizeof(Parser) == 3 * sizeof(uint32_t)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS LIBCPP_STATIC_ASSERT( sizeof(Parser) == (sizeof(wchar_t) <= 2 ? 3 * sizeof(uint32_t) : 4 * sizeof(uint32_t))); #endif +#endif // _WIN32 test(); static_assert(test()); diff --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp @@ -91,7 +91,9 @@ constexpr bool test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test(); #endif diff --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp --- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp +++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp @@ -251,7 +251,9 @@ constexpr bool test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test(); #endif diff --git a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp --- a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp @@ -183,7 +183,9 @@ test(); test(); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif test(); test(); @@ -209,7 +211,9 @@ test(); test(); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif test(); test(); diff --git a/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp --- a/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp @@ -56,7 +56,9 @@ static_assert((std::is_same, std::atomic_ulong>::value), ""); static_assert((std::is_same, std::atomic_llong>::value), ""); static_assert((std::is_same, std::atomic_ullong>::value), ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert((std::is_same, std::atomic_wchar_t>::value), ""); +#endif #if TEST_STD_VER > 17 && defined(__cpp_char8_t) static_assert((std::is_same, std::atomic_char8_t>::value), ""); #endif diff --git a/libcxx/test/std/atomics/types.pass.cpp b/libcxx/test/std/atomics/types.pass.cpp --- a/libcxx/test/std/atomics/types.pass.cpp +++ b/libcxx/test/std/atomics/types.pass.cpp @@ -118,7 +118,9 @@ #endif test (); test (); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test (); +#endif test (); test (); diff --git a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp --- a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp +++ b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp @@ -236,14 +236,18 @@ // Strings test_true (); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_true (); +#endif test_true (); test_true (); test_true (); // String views test_true (); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_true (); +#endif test_true (); test_true (); test_true (); diff --git a/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp --- a/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -19,6 +18,10 @@ #include "test_macros.h" +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# include +#endif + int main(int, char**) { // typedef int8_t @@ -238,6 +241,7 @@ // SIZE_MAX assert(SIZE_MAX == std::numeric_limits::max()); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS // WCHAR_MIN assert(WCHAR_MIN == std::numeric_limits::min()); @@ -249,6 +253,7 @@ // WINT_MAX assert(WINT_MAX == std::numeric_limits::max()); +#endif #ifndef INT8_C #error INT8_C not defined diff --git a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp --- a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // #include diff --git a/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp --- a/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // #include diff --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp --- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp +++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp @@ -28,33 +28,40 @@ int main(int, char**) { const char eight = '8'; const std::string nine = "9"; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS const std::wstring ten = L"10"; +#endif const int eleven = 11; -// Narrow streams w/rvalues + // Narrow streams w/rvalues { exper::ostream_joiner oj(std::cout, '8'); } { exper::ostream_joiner oj(std::cout, std::string("9")); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::cout, std::wstring(L"10")); } +#endif { exper::ostream_joiner oj(std::cout, 11); } -// Narrow streams w/lvalues + // Narrow streams w/lvalues { exper::ostream_joiner oj(std::cout, eight); } { exper::ostream_joiner oj(std::cout, nine); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::cout, ten); } +#endif { exper::ostream_joiner oj(std::cout, eleven); } -// Wide streams w/rvalues +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + // Wide streams w/rvalues { exper::ostream_joiner oj(std::wcout, '8'); } { exper::ostream_joiner oj(std::wcout, std::string("9")); } { exper::ostream_joiner oj(std::wcout, std::wstring(L"10")); } { exper::ostream_joiner oj(std::wcout, 11); } -// Wide streams w/lvalues + // Wide streams w/lvalues { exper::ostream_joiner oj(std::wcout, eight); } { exper::ostream_joiner oj(std::wcout, nine); } { exper::ostream_joiner oj(std::wcout, ten); } { exper::ostream_joiner oj(std::wcout, eleven); } - +#endif return 0; } diff --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp --- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp +++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp @@ -85,8 +85,10 @@ test("Z", chars, chars+10, "0Z1Z2Z3Z4Z5Z6Z7Z8Z9"); test("z", ints, ints+10, "10z11z12z13z14z15z16z17z18z19"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ('X', chars, chars+10, L"0X1X2X3X4X5X6X7X8X9"); test ('x', ints, ints+10, L"10x11x12x13x14x15x16x17x18x19"); +#endif // test('X', chars, chars+10, u"0X1X2X3X4X5X6X7X8X9"); // test('x', ints, ints+10, u"10x11x12x13x14x15x16x17x18x19"); // test('X', chars, chars+10, U"0X1X2X3X4X5X6X7X8X9"); @@ -96,6 +98,7 @@ test(mutating_delimiter2(), chars, chars+10, "0 1!2\"3#4$5%6&7'8(9"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const wchar_t chars[] = L"0123456789"; const int ints [] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; @@ -116,7 +119,7 @@ test(mutating_delimiter(), chars, chars+10, L"0 1!2\"3#4$5%6&7'8(9"); } - +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp --- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp +++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp @@ -36,13 +36,17 @@ { exper::ostream_joiner oj(std::cout, '8'); test(oj); } { exper::ostream_joiner oj(std::cout, std::string("9")); test(oj); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::cout, std::wstring(L"10")); test(oj); } +#endif { exper::ostream_joiner oj(std::cout, 11); test(oj); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::wcout, '8'); test(oj); } { exper::ostream_joiner oj(std::wcout, std::string("9")); test(oj); } { exper::ostream_joiner oj(std::wcout, std::wstring(L"10")); test(oj); } { exper::ostream_joiner oj(std::wcout, 11); test(oj); } +#endif return 0; } diff --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp --- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp +++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp @@ -36,13 +36,17 @@ { exper::ostream_joiner oj(std::cout, '8'); test(oj); } { exper::ostream_joiner oj(std::cout, std::string("9")); test(oj); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::cout, std::wstring(L"10")); test(oj); } +#endif { exper::ostream_joiner oj(std::cout, 11); test(oj); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::wcout, '8'); test(oj); } { exper::ostream_joiner oj(std::wcout, std::string("9")); test(oj); } { exper::ostream_joiner oj(std::wcout, std::wstring(L"10")); test(oj); } { exper::ostream_joiner oj(std::wcout, 11); test(oj); } +#endif return 0; } diff --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp --- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp +++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp @@ -36,13 +36,17 @@ { exper::ostream_joiner oj(std::cout, '8'); test(oj); } { exper::ostream_joiner oj(std::cout, std::string("9")); test(oj); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::cout, std::wstring(L"10")); test(oj); } +#endif { exper::ostream_joiner oj(std::cout, 11); test(oj); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { exper::ostream_joiner oj(std::wcout, '8'); test(oj); } { exper::ostream_joiner oj(std::wcout, std::string("9")); test(oj); } { exper::ostream_joiner oj(std::wcout, std::wstring(L"10")); test(oj); } { exper::ostream_joiner oj(std::wcout, 11); test(oj); } +#endif return 0; } diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp --- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp +++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp @@ -45,9 +45,11 @@ { { test_match_result_typedef(); - test_match_result_typedef(); test_match_result_typedef(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + test_match_result_typedef(); test_match_result_typedef(); +#endif } { // Check that std::match_results has been included and is complete. diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp --- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp +++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp @@ -54,13 +54,17 @@ { { test_string_typedef(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_string_typedef(); +#endif test_string_typedef(); test_string_typedef(); } { test_basic_string_alias>(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_basic_string_alias>(); +#endif test_basic_string_alias>(); test_basic_string_alias>(); } diff --git a/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp b/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp --- a/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp @@ -927,8 +927,10 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp @@ -36,6 +36,8 @@ assert(f2.sgetc() == '2'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfilebuf f; assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in @@ -51,6 +53,7 @@ assert(f2.sgetc() == L'2'); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp @@ -36,6 +36,8 @@ assert(f2.sgetc() == '2'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfilebuf f; assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in @@ -51,6 +53,7 @@ assert(f2.sgetc() == L'2'); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp @@ -38,6 +38,8 @@ assert(f2.sgetc() == '2'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfilebuf f; assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in @@ -53,6 +55,7 @@ assert(f2.sgetc() == L'2'); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp @@ -24,10 +24,12 @@ std::filebuf f; assert(!f.is_open()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfilebuf f; assert(!f.is_open()); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp @@ -35,6 +35,8 @@ assert(f2.sgetc() == '2'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfilebuf f; assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in @@ -49,6 +51,7 @@ assert(f2.sgetc() == L'2'); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp @@ -42,6 +42,8 @@ assert(f.sbumpc() == '3'); } std::remove(p.string().c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfilebuf f; assert(f.open(p, std::ios_base::out) != 0); @@ -56,7 +58,8 @@ assert(f.sbumpc() == L'2'); assert(f.sbumpc() == L'3'); } - remove(p.string().c_str()); + std::remove(p.string().c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp @@ -33,6 +33,8 @@ assert(f.sbumpc() == '3'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfilebuf f; assert(f.open(temp.c_str(), std::ios_base::out) != 0); @@ -47,7 +49,8 @@ assert(f.sbumpc() == L'2'); assert(f.sbumpc() == L'3'); } - remove(temp.c_str()); + std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp @@ -80,6 +80,8 @@ assert(f.sgetc() == 'a'); } std::remove("overflow.dat"); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test_buf f; assert(f.open("overflow.dat", std::ios_base::out) != 0); @@ -143,6 +145,7 @@ assert(f.sbumpc() == -1); } std::remove("overflow.dat"); +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp @@ -43,6 +43,8 @@ assert(f.sgetc() == 'l'); } std::remove("seekoff.dat"); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { wchar_t buf[10]; typedef std::filebuf::pos_type pos_type; @@ -64,6 +66,7 @@ assert(f.sgetc() == L'l'); } std::remove("seekoff.dat"); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp @@ -78,6 +78,7 @@ assert(*f.gptr() == '9'); assert(f.egptr() - f.gptr() == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test_buf f; assert(f.open("underflow.dat", std::ios_base::in) != 0); @@ -125,6 +126,7 @@ assert(f.sbumpc() == 0x4E53); assert(f.sbumpc() == static_cast(-1)); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp @@ -65,6 +65,8 @@ } std::remove(temp1.c_str()); std::remove(temp2.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc); @@ -88,6 +90,7 @@ } std::remove(temp1.c_str()); std::remove(temp2.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp @@ -33,6 +33,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc); @@ -45,6 +47,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp @@ -67,6 +67,8 @@ } std::remove(temp1.c_str()); std::remove(temp2.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc); @@ -90,6 +92,7 @@ } std::remove(temp1.c_str()); std::remove(temp2.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp @@ -23,9 +23,11 @@ { std::fstream fs; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs; } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp @@ -32,6 +32,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fso(temp, std::ios_base::in | std::ios_base::out | std::ios_base::trunc); @@ -43,6 +45,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp @@ -40,6 +40,8 @@ assert(x == 3.25); } std::remove(p.string().c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs(p, std::ios_base::in | std::ios_base::out | std::ios_base::trunc); @@ -50,6 +52,7 @@ assert(x == 3.25); } std::remove(p.string().c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp @@ -31,6 +31,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::trunc); @@ -41,6 +43,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp @@ -32,6 +32,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs(temp, std::ios_base::in | std::ios_base::out @@ -43,6 +45,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp @@ -30,6 +30,8 @@ assert(!fs.is_open()); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs; assert(!fs.is_open()); @@ -39,6 +41,7 @@ assert(!fs.is_open()); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp @@ -40,6 +40,8 @@ assert(x == 3.25); } std::remove(p.string().c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream stream; assert(!stream.is_open()); @@ -53,6 +55,7 @@ assert(x == 3.25); } std::remove(p.string().c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp @@ -34,6 +34,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs; assert(!fs.is_open()); @@ -47,6 +49,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp @@ -34,6 +34,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs; assert(!fs.is_open()); @@ -47,6 +49,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp @@ -24,10 +24,13 @@ std::fstream fs; assert(fs.rdbuf()); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wfstream fs; assert(fs.rdbuf()); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp @@ -32,6 +32,7 @@ fs2 >> x; assert(x == 3.25); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs1("test.dat"); std::wifstream fs2("test2.dat"); @@ -42,6 +43,7 @@ fs2 >> x; assert(x == 3.25); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp @@ -30,6 +30,7 @@ fs >> x; assert(x == 3.25); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fso("test.dat"); std::wifstream fs; @@ -38,6 +39,7 @@ fs >> x; assert(x == 3.25); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp @@ -33,6 +33,7 @@ fs2 >> x; assert(x == 3.25); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs1("test.dat"); std::wifstream fs2("test2.dat"); @@ -43,6 +44,7 @@ fs2 >> x; assert(x == 3.25); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp @@ -23,9 +23,11 @@ { std::ifstream fs; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs; } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp @@ -29,6 +29,7 @@ fs >> x; assert(x == 3.25); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fso("test.dat"); std::wifstream fs = std::move(fso); @@ -36,6 +37,7 @@ fs >> x; assert(x == 3.25); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp @@ -48,6 +48,8 @@ // std::ifstream(const fs::path&, std::ios_base::openmode) is tested in // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp // which creates writable files. + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs(fs::path("test.dat")); double x = 0; @@ -57,6 +59,7 @@ // std::wifstream(const fs::path&, std::ios_base::openmode) is tested in // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp // which creates writable files. +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp @@ -31,6 +31,8 @@ // std::ifstream(const char*, std::ios_base::openmode) is tested in // test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp // which creates writable files. + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs("test.dat"); double x = 0; @@ -40,6 +42,7 @@ // std::wifstream(const char*, std::ios_base::openmode) is tested in // test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp // which creates writable files. +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp @@ -31,6 +31,8 @@ // std::ifstream(const std::string&, std::ios_base::openmode) is tested in // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp // which creates writable files. + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs(std::string("test.dat")); double x = 0; @@ -40,6 +42,7 @@ // std::wifstream(const std::string&, std::ios_base::openmode) is tested in // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp // which creates writable files. +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp @@ -30,6 +30,7 @@ fs.close(); assert(!fs.is_open()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs; assert(!fs.is_open()); @@ -38,6 +39,7 @@ fs.close(); assert(!fs.is_open()); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp @@ -40,6 +40,7 @@ fs >> c; assert(c == 'r'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs; assert(!fs.is_open()); @@ -52,6 +53,7 @@ fs >> c; assert(c == L'r'); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp @@ -34,6 +34,7 @@ fs >> c; assert(c == 'r'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs; assert(!fs.is_open()); @@ -46,6 +47,7 @@ fs >> c; assert(c == L'r'); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp @@ -34,6 +34,7 @@ fs >> c; assert(c == 'r'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs; assert(!fs.is_open()); @@ -46,6 +47,7 @@ fs >> c; assert(c == L'r'); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp @@ -27,11 +27,13 @@ std::filebuf* fb = fs.rdbuf(); assert(fb->sgetc() == 'r'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wifstream fs("test.dat"); std::wfilebuf* fb = fs.rdbuf(); assert(fb->sgetc() == L'r'); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp @@ -69,6 +69,8 @@ assert(x == 3.25); } std::remove(temp2.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs1(temp1.c_str()); std::wofstream fs2(temp2.c_str()); @@ -96,6 +98,7 @@ assert(x == 3.25); } std::remove(temp2.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp @@ -34,6 +34,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fso(temp.c_str()); std::wofstream fs; @@ -47,6 +49,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp @@ -70,6 +70,8 @@ assert(x == 3.25); } std::remove(temp2.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs1(temp1.c_str()); std::wofstream fs2(temp2.c_str()); @@ -97,6 +99,7 @@ assert(x == 3.25); } std::remove(temp2.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp @@ -23,9 +23,11 @@ { std::ofstream fs; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs; } +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp @@ -33,6 +33,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fso(temp.c_str()); std::wofstream fs = std::move(fso); @@ -45,6 +47,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp @@ -53,6 +53,8 @@ assert(x == 3.25); } std::remove(p.string().c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream stream(p); stream << 3.25; @@ -70,6 +72,7 @@ assert(x == 3.25); } std::remove(p.string().c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp @@ -38,6 +38,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs(temp.c_str()); fs << 3.25; @@ -55,6 +57,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp @@ -38,6 +38,8 @@ assert(x == 3.25); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs(temp); fs << 3.25; @@ -55,6 +57,7 @@ assert(x == 3.25); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp @@ -30,6 +30,8 @@ assert(!fs.is_open()); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs; assert(!fs.is_open()); @@ -39,6 +41,7 @@ assert(!fs.is_open()); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp @@ -46,6 +46,8 @@ assert(c == 'a'); } std::remove(p.string().c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs; assert(!fs.is_open()); @@ -63,6 +65,7 @@ assert(c == L'a'); } std::remove(p.string().c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp @@ -38,6 +38,8 @@ assert(c == 'a'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs; assert(!fs.is_open()); @@ -55,6 +57,7 @@ assert(c == L'a'); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp @@ -38,6 +38,8 @@ assert(c == 'a'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs; assert(!fs.is_open()); @@ -55,6 +57,7 @@ assert(c == L'a'); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp @@ -27,12 +27,15 @@ assert(fb->sputc('r') == 'r'); } std::remove(temp.c_str()); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wofstream fs(temp.c_str()); std::wfilebuf* fb = fs.rdbuf(); assert(fb->sputc(L'r') == L'r'); } std::remove(temp.c_str()); +#endif return 0; } diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp @@ -386,14 +386,18 @@ assert(&Res == &LHS); } doAppendSourceTest (TC); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS doAppendSourceTest (TC); +#endif doAppendSourceTest(TC); doAppendSourceTest(TC); } for (auto const & TC : LongLHSCases) { (void)TC; LIBCPP_ONLY(doAppendSourceAllocTest(TC)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS LIBCPP_ONLY(doAppendSourceAllocTest(TC)); +#endif } test_sfinae(); diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp @@ -236,7 +236,9 @@ int main(int, char**) { for (auto const& MS : PathList) { RunTestCase(MS); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS RunTestCase(MS); +#endif RunTestCase(MS); RunTestCase(MS); RunStringMoveTest(MS); diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp @@ -39,11 +39,6 @@ #include "test_macros.h" #include "filesystem_test_helper.h" -// libstdc++ doesn't define conversions from/to wchar_t outside of windows. -#if defined(__GLIBCXX__) && !defined(_WIN32) -# define HAS_NO_WCHAR -#endif - // Test conversion with strings that fit within the latin1 charset, that fit // within one code point in UTF-16, and that can be expressible in certain // one-byte code pages. @@ -57,7 +52,7 @@ #else const char u8str[] = { char(0xc3), char(0xa5), char(0xc3), char(0xa4), char(0xc3), char(0xb6), 0x00 }; #endif -#ifndef HAS_NO_WCHAR +#ifndef TEST_HAS_NO_WIDE_CHARACTERS const wchar_t wstr[] = { 0xe5, 0xe4, 0xf6, 0x00 }; #endif @@ -112,7 +107,7 @@ assert(p.string() == u8str); } #endif -#ifndef HAS_NO_WCHAR +#ifndef TEST_HAS_NO_WIDE_CHARACTERS // Test conversion to/from wchar_t. { const fs::path p(u16str); @@ -132,7 +127,7 @@ assert(p.u32string() == u32str); assert(p.string() == wstr); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS #ifndef _WIN32 // Test conversion to/from regular char-based string. On POSIX, this // is implied to convert to/from UTF-8. @@ -226,14 +221,13 @@ assert(p.u16string() == u16str); assert(p.u32string() == u32str); } -#if !defined(HAS_NO_WCHAR) && defined(__SIZEOF_WCHAR_T__) -#if __SIZEOF_WCHAR_T__ == 2 +#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__) +# if __SIZEOF_WCHAR_T__ == 2 const wchar_t wstr[] = { 0xd801, 0xdc37, 0x00 }; -#else +# else const wchar_t wstr[] = { 0x10437, 0x00 }; -#endif +# endif // Test conversion to/from wchar_t. - // libstdc++ doesn't define conversions from/to wchar_t outside of windows. { const fs::path p = fs::u8path(str); assert(p.wstring() == wstr); @@ -253,7 +247,7 @@ assert(p.u32string() == u32str); assert(p.wstring() == wstr); } -#endif +#endif // !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__) } // Test appending paths in different encodings. @@ -273,14 +267,13 @@ p /= u32str; assert(p.u32string() == u32ref); } -#if !defined(HAS_NO_WCHAR) && defined(__SIZEOF_WCHAR_T__) -#if __SIZEOF_WCHAR_T__ == 2 +#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__) +# if __SIZEOF_WCHAR_T__ == 2 const wchar_t wstr[] = { 0xd801, 0xdc37, 0x00 }; -#else +# else const wchar_t wstr[] = { 0x10437, 0x00 }; -#endif +# endif // Test conversion from wchar_t. - // libstdc++ doesn't define conversions from/to wchar_t outside of windows. { fs::path p = fs::path(u16str) / wstr / u32str; assert(p.u32string() == u32ref); @@ -291,7 +284,7 @@ p /= u32str; assert(p.u32string() == u32ref); } -#endif +#endif // !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__) } static void test_concat() @@ -308,14 +301,13 @@ p = fs::u8path(str).concat(u16str).concat(u32str); assert(p.u32string() == u32ref); } -#if !defined(HAS_NO_WCHAR) && defined(__SIZEOF_WCHAR_T__) -#if __SIZEOF_WCHAR_T__ == 2 +#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__) +# if __SIZEOF_WCHAR_T__ == 2 const wchar_t wstr[] = { 0xd801, 0xdc37, 0x00 }; -#else +# else const wchar_t wstr[] = { 0x10437, 0x00 }; -#endif +# endif // Test conversion from wchar_t. - // libstdc++ doesn't define conversions from/to wchar_t outside of windows. { fs::path p = fs::path(u16str); p += wstr; @@ -324,7 +316,7 @@ p = fs::path(u16str).concat(wstr).concat(u32str); assert(p.u32string() == u32ref); } -#endif +#endif // !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__) } static void test_append_concat_narrow() diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp @@ -361,7 +361,9 @@ assert(&Ref == &LHS); } doConcatSourceTest (TC); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS doConcatSourceTest (TC); +#endif doConcatSourceTest(TC); doConcatSourceTest(TC); } @@ -392,11 +394,15 @@ assert(LHS == E); } LIBCPP_ONLY(doConcatSourceAllocTest(TC)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS LIBCPP_ONLY(doConcatSourceAllocTest(TC)); +#endif } for (auto const& TC : CharTestCases) { doConcatECharTest(TC); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS doConcatECharTest(TC); +#endif doConcatECharTest(TC); doConcatECharTest(TC); } diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp @@ -129,7 +129,9 @@ #if TEST_STD_VER > 17 && defined(__cpp_char8_t) RunTestCase(MS); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS RunTestCase(MS); +#endif RunTestCase(MS); RunTestCase(MS); } diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp @@ -62,7 +62,9 @@ int main(int, char**) { doAllocTest(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS doAllocTest(); +#endif doAllocTest(); doAllocTest(); #if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t) diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp @@ -62,10 +62,12 @@ assert(s == (const char*)MS); #endif } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s = p.generic_wstring(); assert(s == (const wchar_t*)MS); } +#endif { std::u16string s = p.generic_u16string(); assert(s == (const char16_t*)MS); diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp @@ -56,10 +56,12 @@ assert(s == (const char*)MS); #endif } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s = p.wstring(); assert(s == (const wchar_t*)MS); } +#endif { std::u16string s = p.u16string(); assert(s == (const char16_t*)MS); diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp @@ -36,8 +36,6 @@ MultiStringType InStr = MKSTR("abcdefg/\"hijklmnop\"/qrstuvwxyz/123456789"); MultiStringType OutStr = MKSTR("\"abcdefg/\\\"hijklmnop\\\"/qrstuvwxyz/123456789\""); - - template void doIOTest() { using namespace fs; @@ -83,15 +81,19 @@ struct is_istreamable : decltype(impl::is_istreamable_imp(0)) {}; void test_LWG2989() { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(!is_ostreamable::value, ""); static_assert(!is_ostreamable::value, ""); static_assert(!is_istreamable::value, ""); static_assert(!is_istreamable::value, ""); +#endif } int main(int, char**) { doIOTest(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS doIOTest(); +#endif //doIOTest(); //doIOTest(); test_LWG2989(); diff --git a/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp @@ -59,6 +59,7 @@ is >> std::get_money(x, true); assert(x == -123456789); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -$1,234,567.89"); std::wistream is(&sb); @@ -75,6 +76,7 @@ is >> std::get_money(x, true); assert(x == -123456789); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp @@ -57,6 +57,7 @@ assert(is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" Sat Dec 31 23:55:59 2061"); std::wistream is(&sb); @@ -73,6 +74,7 @@ assert(is.eof()); assert(!is.fail()); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp @@ -73,6 +73,7 @@ os << std::put_money(x, true); assert(sb.str() == "-USD 1,234,567.89"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wostream os(&sb); @@ -91,6 +92,7 @@ os << std::put_money(x, true); assert(sb.str() == L"-USD 1,234,567.89"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp @@ -69,6 +69,7 @@ os << std::put_time(&t, "%a %b %d %H:%M:%S %Y"); assert(sb.str() == "Sat Dec 31 23:55:59 2061"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wostream os(&sb); @@ -84,6 +85,7 @@ os << std::put_time(&t, L"%a %b %d %H:%M:%S %Y"); assert(sb.str() == L"Sat Dec 31 23:55:59 2061"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp @@ -60,6 +60,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb1; testbuf sb2; @@ -83,6 +84,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp @@ -63,6 +63,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb1; testbuf sb2; @@ -86,6 +87,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp @@ -56,6 +56,7 @@ assert(is.precision() == 6); assert(is.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; test_iostream is1(&sb); @@ -72,6 +73,7 @@ assert(is.precision() == 6); assert(is.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp @@ -40,6 +40,7 @@ assert(is.getloc().name() == "C"); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_iostream is(&sb); @@ -53,6 +54,7 @@ assert(is.getloc().name() == "C"); assert(is.gcount() == 0); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 1 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -123.5 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -123.5 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp @@ -70,6 +70,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -1234567890123456 "); std::wistream is(&sb); @@ -79,6 +80,7 @@ assert(!is.eof()); assert( is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -123 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -123.5 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -123 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 1 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif { testbuf sb("12345678"); std::istream is(&sb); @@ -87,6 +89,7 @@ assert( is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"12345678"); std::wistream is(&sb); @@ -96,6 +99,7 @@ assert( is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp @@ -70,6 +70,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" -1234567890 "); std::wistream is(&sb); @@ -79,6 +80,7 @@ assert(!is.eof()); assert( is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp @@ -69,6 +69,7 @@ assert(!is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123 "); std::wistream is(&sb); @@ -78,6 +79,7 @@ assert(!is.eof()); assert(!is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp @@ -67,6 +67,7 @@ assert(!is.fail()); assert(c == 'c'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" abc"); std::wistream is(&sb); @@ -84,6 +85,7 @@ assert(!is.fail()); assert(c == L'c'); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; @@ -103,6 +105,7 @@ assert(is.eof()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -121,6 +124,7 @@ assert(is.eof()); assert(threw); } +#endif { testbuf sb; std::basic_istream is(&sb); @@ -139,6 +143,7 @@ assert(is.eof()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -157,6 +162,7 @@ assert(is.eof()); assert(threw); } +#endif #endif // TEST_HAS_NO_EXCEPTIONS return 0; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp @@ -86,6 +86,7 @@ assert( is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -102,6 +103,7 @@ assert( is.eof()); assert(!is.fail()); } +#endif { testbuf sb; @@ -119,6 +121,7 @@ assert( is.eof()); assert( is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -135,6 +138,7 @@ assert( is.eof()); assert( is.fail()); } +#endif { testbuf sb; @@ -151,6 +155,7 @@ assert(!is.eof()); assert( is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -167,6 +172,7 @@ assert( is.fail()); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp @@ -61,6 +61,7 @@ assert(std::string(s) == "abc"); } #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" abcdefghijk "); std::wistream is(&sb); @@ -93,6 +94,7 @@ assert(std::wstring(s) == L"abc"); } #endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(" abcdefghijk"); std::istream is(&sb); @@ -135,6 +137,7 @@ assert(is.eof()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wistream is(&sb); @@ -154,6 +157,7 @@ assert(is.eof()); assert(threw); } +#endif { testbuf sb; std::basic_istream is(&sb); @@ -173,6 +177,7 @@ assert(is.eof()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wistream is(&sb); @@ -192,6 +197,7 @@ assert(is.eof()); assert(threw); } +#endif #endif // TEST_HAS_NO_EXCEPTIONS return 0; diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp @@ -49,6 +49,7 @@ assert(is.good()); assert(is.peek() == '1'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123"); std::wistream is(&sb); @@ -56,6 +57,7 @@ assert(is.good()); assert(is.peek() == L'1'); } +#endif { testbuf sb(" "); std::istream is(&sb); @@ -66,6 +68,7 @@ assert(is.eof()); assert(is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::wistream is(&sb); @@ -76,6 +79,7 @@ assert(is.eof()); assert(is.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -94,6 +98,7 @@ assert( is.eof()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -111,7 +116,8 @@ assert( is.eof()); assert(threw); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp @@ -63,6 +63,7 @@ assert(&result == &is); assert(i.value == 123); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123"); Int i = {0}; @@ -71,6 +72,7 @@ assert(&result == &is); assert(i.value == 123); } +#endif { // test perfect forwarding assert(called == false); diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp @@ -75,6 +75,7 @@ assert(c == 'c'); assert(is.gcount() == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" abc"); std::wistream is(&sb); @@ -99,6 +100,7 @@ assert(c == L'c'); assert(is.gcount() == 1); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb("rrrrrrrrr"); @@ -121,6 +123,7 @@ assert( is.eof()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"rrrrrrrrr"); std::basic_istream is(&sb); @@ -143,6 +146,7 @@ assert(threw); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp @@ -77,6 +77,7 @@ assert(c == 'c'); assert(is.gcount() == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" abc"); std::wistream is(&sb); @@ -102,6 +103,7 @@ assert(c == L'c'); assert(is.gcount() == 1); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb("rrrrrrrrr"); @@ -125,6 +127,7 @@ assert( is.eof()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"rrrrrrrrr"); std::basic_istream is(&sb); @@ -147,7 +150,8 @@ assert( is.eof()); assert(threw); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp @@ -79,6 +79,7 @@ assert(std::string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" \n \n "); std::wistream is(&sb); @@ -113,6 +114,7 @@ assert(std::wstring(s) == L""); assert(is.gcount() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -132,6 +134,7 @@ assert(std::string(s) == " "); assert(is.gcount() == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -150,6 +153,7 @@ assert(std::wstring(s) == L" "); assert(is.gcount() == 1); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; @@ -169,6 +173,7 @@ assert(std::basic_string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -187,7 +192,8 @@ assert(std::basic_string(s) == L""); assert(is.gcount() == 0); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp @@ -79,6 +79,7 @@ assert(std::string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" * * "); std::wistream is(&sb); @@ -113,6 +114,7 @@ assert(std::wstring(s) == L""); assert(is.gcount() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -132,6 +134,7 @@ assert(std::basic_string(s) == " "); assert(is.gcount() == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -150,6 +153,7 @@ assert(std::basic_string(s) == L" "); assert(is.gcount() == 1); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; @@ -169,6 +173,7 @@ assert(std::basic_string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -187,7 +192,8 @@ assert(std::basic_string(s) == L""); assert(is.gcount() == 0); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp @@ -73,6 +73,7 @@ assert(!is.fail()); assert(is.gcount() == 3); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"testing\n..."); std::wistream is(&sb); @@ -88,6 +89,7 @@ assert(!is.fail()); assert(is.gcount() == 3); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -105,6 +107,7 @@ assert( is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -121,6 +124,7 @@ assert( is.eof()); assert(!is.fail()); } +#endif { testbuf sb; @@ -138,6 +142,7 @@ assert( is.eof()); assert( is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -155,6 +160,7 @@ assert( is.fail()); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp @@ -73,6 +73,7 @@ assert(!is.fail()); assert(is.gcount() == 3); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"testing*..."); std::wistream is(&sb); @@ -88,6 +89,7 @@ assert(!is.fail()); assert(is.gcount() == 3); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -105,6 +107,7 @@ assert( is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -121,6 +124,7 @@ assert( is.eof()); assert(!is.fail()); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; @@ -138,6 +142,7 @@ assert( is.eof()); assert( is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -154,7 +159,8 @@ assert( is.eof()); assert( is.fail()); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp @@ -71,6 +71,7 @@ assert(std::string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" \n \n "); std::wistream is(&sb); @@ -97,6 +98,7 @@ assert(std::wstring(s) == L""); assert(is.gcount() == 0); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -116,6 +118,7 @@ assert(std::basic_string(s) == " "); assert(is.gcount() == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -134,6 +137,7 @@ assert(std::basic_string(s) == L" "); assert(is.gcount() == 1); } +#endif { testbuf sb; @@ -153,6 +157,7 @@ assert(std::basic_string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -172,6 +177,7 @@ assert(is.gcount() == 0); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp @@ -71,6 +71,7 @@ assert(std::string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" * * "); std::wistream is(&sb); @@ -97,6 +98,7 @@ assert(std::wstring(s) == L""); assert(is.gcount() == 0); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -116,6 +118,7 @@ assert(std::basic_string(s) == " "); assert(is.gcount() == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -134,6 +137,7 @@ assert(std::basic_string(s) == L" "); assert(is.gcount() == 1); } +#endif { testbuf sb; @@ -153,6 +157,7 @@ assert(std::basic_string(s) == ""); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -172,6 +177,7 @@ assert(is.gcount() == 0); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp @@ -60,6 +60,7 @@ assert(!is.fail()); assert(is.gcount() == 6); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 1\n2345\n6"); std::wistream is(&sb); @@ -76,6 +77,7 @@ assert(!is.fail()); assert(is.gcount() == 6); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb(" "); @@ -92,6 +94,7 @@ assert( is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" "); std::basic_istream is(&sb); @@ -108,6 +111,7 @@ assert(!is.fail()); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp @@ -55,6 +55,7 @@ assert(!is.fail()); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 1\n2345\n6"); std::wistream is(&sb); @@ -68,6 +69,7 @@ assert(!is.fail()); assert(is.gcount() == 0); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; @@ -84,6 +86,7 @@ assert( is.eof()); assert(!is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -100,6 +103,7 @@ assert(!is.fail()); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp @@ -64,6 +64,7 @@ assert(is.bad()); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123456789"); std::wistream is(&sb); @@ -87,6 +88,7 @@ assert(is.bad()); assert(is.gcount() == 0); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; @@ -103,6 +105,7 @@ assert(!is.eof()); assert( is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -119,6 +122,7 @@ assert( is.fail()); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp @@ -61,6 +61,7 @@ assert( is.fail()); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123456789"); std::wistream is(&sb); @@ -80,6 +81,7 @@ assert( is.fail()); assert(is.gcount() == 0); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; @@ -97,6 +99,7 @@ assert( is.eof()); assert( is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -114,6 +117,7 @@ assert( is.fail()); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp @@ -62,6 +62,7 @@ assert(std::string(s, 1) == "0"); assert(is.readsome(s, 5) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 1234567890"); std::wistream is(&sb); @@ -83,6 +84,7 @@ assert(std::wstring(s, 1) == L"0"); assert(is.readsome(s, 5) == 0); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp @@ -56,6 +56,7 @@ is.seekg(-1); assert(is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123456789"); std::wistream is(&sb); @@ -64,6 +65,7 @@ is.seekg(-1); assert(is.fail()); } +#endif { testbuf sb(" 123456789"); std::istream is(&sb); diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp @@ -64,6 +64,7 @@ assert(is.fail()); assert(seekoff_called == 2); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123456789"); std::wistream is(&sb); @@ -74,6 +75,7 @@ assert(is.fail()); assert(seekoff_called == 4); } +#endif { testbuf sb(" 123456789"); std::istream is(&sb); diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp @@ -91,12 +91,14 @@ assert(is.sync() == 0); assert(sync_called == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123456789"); std::wistream is(&sb); assert(is.sync() == 0); assert(sync_called == 2); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { throwing_testbuf sb(" 123456789"); @@ -113,6 +115,7 @@ assert( is.fail()); assert(threw); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { throwing_testbuf sb(L" 123456789"); std::basic_istream is(&sb); @@ -129,6 +132,7 @@ assert(threw); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp @@ -56,11 +56,13 @@ std::istream is(&sb); assert(is.tellg() == 5); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123456789"); std::wistream is(&sb); assert(is.tellg() == 5); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp @@ -60,6 +60,7 @@ assert(is.bad()); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L" 123456789"); std::wistream is(&sb); @@ -79,6 +80,7 @@ assert(is.bad()); assert(is.gcount() == 0); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { testbuf sb; @@ -95,6 +97,7 @@ assert(!is.eof()); assert( is.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -111,6 +114,7 @@ assert( is.fail()); } #endif +#endif // TEST_HAS_NO_EXCEPTIONS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp @@ -60,6 +60,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb1; testbuf sb2; @@ -83,6 +84,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp @@ -63,6 +63,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb1; testbuf sb2; @@ -86,6 +87,7 @@ assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp @@ -54,6 +54,7 @@ assert(is.precision() == 6); assert(is.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; test_istream is1(&sb); @@ -70,6 +71,7 @@ assert(is.precision() == 6); assert(is.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp @@ -40,6 +40,7 @@ assert(is.getloc().name() == "C"); assert(is.gcount() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_istream is(&sb); @@ -53,6 +54,7 @@ assert(is.getloc().name() == "C"); assert(is.gcount() == 0); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp @@ -61,14 +61,6 @@ assert(is.gcount() == 0); assert(sync_called == 0); } - { - std::wistream is((testbuf*)0); - std::wistream::sentry sen(is, true); - assert(!(bool)sen); - assert(!is.good()); - assert(is.gcount() == 0); - assert(sync_called == 0); - } { testbuf sb(" 123"); std::istream is(&sb); @@ -79,16 +71,6 @@ assert(sync_called == 0); assert(sb.gptr() == sb.eback()); } - { - testbuf sb(L" 123"); - std::wistream is(&sb); - std::wistream::sentry sen(is, true); - assert((bool)sen); - assert(is.good()); - assert(is.gcount() == 0); - assert(sync_called == 0); - assert(sb.gptr() == sb.eback()); - } { testbuf sb(" 123"); std::istream is(&sb); @@ -98,15 +80,6 @@ assert(sync_called == 0); assert(sb.gptr() == sb.eback() + 3); } - { - testbuf sb(L" 123"); - std::wistream is(&sb); - std::wistream::sentry sen(is); - assert((bool)sen); - assert(is.good()); - assert(sync_called == 0); - assert(sb.gptr() == sb.eback() + 3); - } { testbuf sb(" "); std::istream is(&sb); @@ -127,5 +100,35 @@ assert(sb.gptr() == sb.eback()); } - return 0; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + std::wistream is((testbuf*)0); + std::wistream::sentry sen(is, true); + assert(!(bool)sen); + assert(!is.good()); + assert(is.gcount() == 0); + assert(sync_called == 0); + } + { + testbuf sb(L" 123"); + std::wistream is(&sb); + std::wistream::sentry sen(is, true); + assert((bool)sen); + assert(is.good()); + assert(is.gcount() == 0); + assert(sync_called == 0); + assert(sb.gptr() == sb.eback()); + } + { + testbuf sb(L" 123"); + std::wistream is(&sb); + std::wistream::sentry sen(is); + assert((bool)sen); + assert(is.good()); + assert(sync_called == 0); + assert(sb.gptr() == sb.eback() + 3); + } +#endif + + return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp @@ -60,6 +60,7 @@ assert(os2.precision() == 6); assert(os2.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb1; testbuf sb2; @@ -83,6 +84,7 @@ assert(os2.precision() == 6); assert(os2.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp @@ -63,6 +63,7 @@ assert(os2.precision() == 6); assert(os2.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb1; testbuf sb2; @@ -86,6 +87,7 @@ assert(os2.precision() == 6); assert(os2.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp @@ -54,6 +54,7 @@ assert(os.precision() == 6); assert(os.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; test_ostream os1(&sb); @@ -68,6 +69,7 @@ assert(os.precision() == 6); assert(os.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp @@ -39,6 +39,7 @@ assert(os.precision() == 6); assert(os.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::basic_ostream os(&sb); @@ -51,6 +52,7 @@ assert(os.precision() == 6); assert(os.getloc().name() == "C"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp @@ -14,6 +14,8 @@ // template // basic_ostream& operator<<(basic_ostream& out, charT c); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp @@ -14,6 +14,8 @@ // template // basic_ostream& operator<<(basic_ostream& out, const charT* s); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp @@ -14,6 +14,8 @@ // template // basic_ostream& operator<<(basic_ostream& out, char c); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp @@ -14,6 +14,8 @@ // template // basic_ostream& operator<<(basic_ostream& out, const char* s); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp @@ -70,6 +70,7 @@ assert(sync_called == 1); assert(os.good()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wostream os(&sb); @@ -78,6 +79,7 @@ assert(sync_called == 2); assert(os.good()); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp @@ -61,6 +61,7 @@ assert(sb.str().back() == 0); assert(os.good()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wostream os(&sb); @@ -69,6 +70,7 @@ assert(sb.str().back() == 0); assert(os.good()); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp @@ -49,6 +49,7 @@ assert(sync_called == 1); assert(os.good()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wostream os(&sb); @@ -56,6 +57,7 @@ assert(sync_called == 2); assert(os.good()); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp @@ -67,6 +67,7 @@ assert(&result == &os); assert(sb.str() == "123"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wostream os(&sb); @@ -75,6 +76,7 @@ assert(&result == &os); assert(sb.str() == L"123"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp @@ -52,6 +52,21 @@ int main(int, char**) { + { + std::ostream os((std::streambuf*)0); + char c = 'a'; + os.put(c); + assert(os.bad()); + } + { + testbuf sb; + std::ostream os(&sb); + char c = 'a'; + os.put(c); + assert(sb.str() == "a"); + assert(os.good()); + } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostream os((std::wstreambuf*)0); wchar_t c = L'a'; @@ -66,14 +81,7 @@ assert(sb.str() == L"a"); assert(os.good()); } - { - testbuf sb; - std::ostream os(&sb); - char c = 'a'; - os.put(c); - assert(sb.str() == "a"); - assert(os.good()); - } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp @@ -52,6 +52,21 @@ int main(int, char**) { + { + std::ostream os((std::streambuf*)0); + const char s[] = "123456790"; + os.write(s, sizeof(s)/sizeof(s[0])-1); + assert(os.bad()); + } + { + testbuf sb; + std::ostream os(&sb); + const char s[] = "123456790"; + os.write(s, sizeof(s)/sizeof(s[0])-1); + assert(sb.str() == s); + assert(os.good()); + } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostream os((std::wstreambuf*)0); const wchar_t s[] = L"123456790"; @@ -66,14 +81,7 @@ assert(os.good()); assert(sb.str() == s); } - { - testbuf sb; - std::ostream os(&sb); - const char s[] = "123456790"; - os.write(s, sizeof(s)/sizeof(s[0])-1); - assert(sb.str() == s); - assert(os.good()); - } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp @@ -132,10 +132,12 @@ round_trip_d ( "", 'q' ); round_trip_e ( "", 'q' ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS round_trip ( L"" ); round_trip_ws ( L"" ); round_trip_d ( L"", 'q' ); round_trip_e ( L"", 'q' ); +#endif round_trip ( "Hi" ); round_trip_ws ( "Hi" ); @@ -144,34 +146,47 @@ assert ( quote ( "Hi", '!' ) == "!Hi!" ); assert ( quote ( "Hi!", '!' ) == R"(!Hi\!!)" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS round_trip ( L"Hi" ); round_trip_ws ( L"Hi" ); round_trip_d ( L"Hi", '!' ); round_trip_e ( L"Hi", '!' ); assert ( quote ( L"Hi", '!' ) == L"!Hi!" ); assert ( quote ( L"Hi!", '!' ) == LR"(!Hi\!!)" ); +#endif round_trip ( "Hi Mom" ); round_trip_ws ( "Hi Mom" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS round_trip ( L"Hi Mom" ); round_trip_ws ( L"Hi Mom" ); +#endif assert ( quote ( "" ) == "\"\"" ); - assert ( quote ( L"" ) == L"\"\"" ); assert ( quote ( "a" ) == "\"a\"" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert ( quote ( L"" ) == L"\"\"" ); assert ( quote ( L"a" ) == L"\"a\"" ); +#endif -// missing end quote - must not hang + // missing end quote - must not hang assert ( unquote ( "\"abc" ) == "abc" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert ( unquote ( L"\"abc" ) == L"abc" ); +#endif assert ( unquote ( "abc" ) == "abc" ); // no delimiter - assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter assert ( unquote ( "abc def" ) == "abc" ); // no delimiter +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter +#endif assert ( unquote ( "" ) == "" ); // nothing there +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert ( unquote ( L"" ) == L"" ); // nothing there +#endif + test_padding (); return 0; diff --git a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp --- a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp +++ b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp @@ -11,6 +11,7 @@ // quoted // UNSUPPORTED: c++03, c++11 +// XFAIL: libcpp-has-no-wide-characters #include #include diff --git a/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp @@ -40,6 +40,7 @@ os << std::resetiosflags(std::ios_base::skipws); assert(!(os.flags() & std::ios_base::skipws)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wistream is(&sb); @@ -54,6 +55,7 @@ os << std::resetiosflags(std::ios_base::skipws); assert(!(os.flags() & std::ios_base::skipws)); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp @@ -50,6 +50,7 @@ os << std::setbase(15); assert((os.flags() & std::ios_base::basefield) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wistream is(&sb); @@ -74,6 +75,7 @@ os << std::setbase(15); assert((os.flags() & std::ios_base::basefield) == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp @@ -31,12 +31,14 @@ os << std::setfill('*'); assert(os.fill() == '*'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wostream os(&sb); os << std::setfill(L'*'); assert(os.fill() == L'*'); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp @@ -40,6 +40,7 @@ os << std::setiosflags(std::ios_base::oct); assert(os.flags() & std::ios_base::oct); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wistream is(&sb); @@ -54,6 +55,7 @@ os << std::setiosflags(std::ios_base::oct); assert(os.flags() & std::ios_base::oct); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp @@ -38,6 +38,7 @@ os << std::setprecision(10); assert(os.precision() == 10); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wistream is(&sb); @@ -50,6 +51,7 @@ os << std::setprecision(10); assert(os.precision() == 10); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp @@ -8,7 +8,7 @@ // -// T6 setw(int n); +// setw(int n); #include #include @@ -38,6 +38,7 @@ os << std::setw(10); assert(os.width() == 10); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb; std::wistream is(&sb); @@ -50,6 +51,7 @@ os << std::setw(10); assert(os.width() == 10); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp b/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp --- a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp +++ b/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp @@ -9,10 +9,13 @@ // #include -#include // for mbstate_t #include "test_macros.h" +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# include +#endif + template void test() { Ptr p = 0; @@ -22,71 +25,105 @@ int main(int, char**) { test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test* >(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test* >(); +#endif test*>(); test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif test(); test(); @@ -103,6 +140,7 @@ test(); test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); test(); test(); @@ -117,10 +155,13 @@ test(); test(); test(); +#endif test*>(); test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.objects/init.pass.cpp b/libcxx/test/std/input.output/iostream.objects/init.pass.cpp --- a/libcxx/test/std/input.output/iostream.objects/init.pass.cpp +++ b/libcxx/test/std/input.output/iostream.objects/init.pass.cpp @@ -25,37 +25,24 @@ #include #include +#include "test_macros.h" + struct Checker { char *cerr_mem_dump; char *cin_mem_dump; char *cout_mem_dump; char *clog_mem_dump; - char *wcerr_mem_dump; - char *wcin_mem_dump; - char *wcout_mem_dump; - char *wclog_mem_dump; - Checker() : cerr_mem_dump(new char[sizeof(std::cerr)]) , cin_mem_dump(new char[sizeof(std::cin)]) , cout_mem_dump(new char[sizeof(std::cout)]) , clog_mem_dump(new char[sizeof(std::clog)]) - - , wcerr_mem_dump(new char[sizeof(std::wcerr)]) - , wcin_mem_dump(new char[sizeof(std::wcin)]) - , wcout_mem_dump(new char[sizeof(std::wcout)]) - , wclog_mem_dump(new char[sizeof(std::wclog)]) { std::memcpy(cerr_mem_dump, (char*)&std::cerr, sizeof(std::cerr)); std::memcpy(cin_mem_dump, (char*)&std::cin, sizeof(std::cin)); std::memcpy(cout_mem_dump, (char*)&std::cout, sizeof(std::cout)); std::memcpy(clog_mem_dump, (char*)&std::clog, sizeof(std::clog)); - - std::memcpy(wcerr_mem_dump, (char*)&std::wcerr, sizeof(std::wcerr)); - std::memcpy(wcin_mem_dump, (char*)&std::wcin, sizeof(std::wcin)); - std::memcpy(wcout_mem_dump, (char*)&std::wcout, sizeof(std::wcout)); - std::memcpy(wclog_mem_dump, (char*)&std::wclog, sizeof(std::wclog)); } ~Checker() { @@ -63,7 +50,30 @@ delete[] cin_mem_dump; delete[] cout_mem_dump; delete[] clog_mem_dump; + } +}; +static Checker check; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +struct WideChecker { + char *wcerr_mem_dump; + char *wcin_mem_dump; + char *wcout_mem_dump; + char *wclog_mem_dump; + + WideChecker() + : wcerr_mem_dump(new char[sizeof(std::wcerr)]) + , wcin_mem_dump(new char[sizeof(std::wcin)]) + , wcout_mem_dump(new char[sizeof(std::wcout)]) + , wclog_mem_dump(new char[sizeof(std::wclog)]) + { + std::memcpy(wcerr_mem_dump, (char*)&std::wcerr, sizeof(std::wcerr)); + std::memcpy(wcin_mem_dump, (char*)&std::wcin, sizeof(std::wcin)); + std::memcpy(wcout_mem_dump, (char*)&std::wcout, sizeof(std::wcout)); + std::memcpy(wclog_mem_dump, (char*)&std::wclog, sizeof(std::wclog)); + } + + ~WideChecker() { delete[] wcerr_mem_dump; delete[] wcin_mem_dump; delete[] wcout_mem_dump; @@ -71,7 +81,8 @@ } }; -static Checker check; +static WideChecker wide_check; +#endif int main(int, char**) { assert(std::memcmp(check.cerr_mem_dump, (char const*)&std::cerr, sizeof(std::cerr)) == 0); @@ -79,9 +90,11 @@ assert(std::memcmp(check.cout_mem_dump, (char const*)&std::cout, sizeof(std::cout)) == 0); assert(std::memcmp(check.clog_mem_dump, (char const*)&std::clog, sizeof(std::clog)) == 0); - assert(std::memcmp(check.wcerr_mem_dump, (char const*)&std::wcerr, sizeof(std::wcerr)) == 0); - assert(std::memcmp(check.wcin_mem_dump, (char const*)&std::wcin, sizeof(std::wcin)) == 0); - assert(std::memcmp(check.wcout_mem_dump, (char const*)&std::wcout, sizeof(std::wcout)) == 0); - assert(std::memcmp(check.wclog_mem_dump, (char const*)&std::wclog, sizeof(std::wclog)) == 0); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::memcmp(wide_check.wcerr_mem_dump, (char const*)&std::wcerr, sizeof(std::wcerr)) == 0); + assert(std::memcmp(wide_check.wcin_mem_dump, (char const*)&std::wcin, sizeof(std::wcin)) == 0); + assert(std::memcmp(wide_check.wcout_mem_dump, (char const*)&std::wcout, sizeof(std::wcout)) == 0); + assert(std::memcmp(wide_check.wclog_mem_dump, (char const*)&std::wclog, sizeof(std::wclog)) == 0); +#endif return 0; } diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp @@ -10,6 +10,7 @@ // istream wcerr; +// XFAIL: libcpp-has-no-wide-characters // XFAIL: LIBCXX-WINDOWS-FIXME // FILE_DEPENDENCIES: ../check-stderr.sh diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp @@ -10,6 +10,8 @@ // istream wcin; +// XFAIL: libcpp-has-no-wide-characters + // FILE_DEPENDENCIES: ../send-stdin.sh // RUN: %{build} // RUN: %{exec} bash send-stdin.sh "%t.exe" "1234" diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp @@ -10,6 +10,7 @@ // istream wclog; +// XFAIL: libcpp-has-no-wide-characters // XFAIL: LIBCXX-WINDOWS-FIXME // FILE_DEPENDENCIES: ../check-stderr.sh diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp @@ -10,6 +10,7 @@ // istream wcout; +// XFAIL: libcpp-has-no-wide-characters // XFAIL: LIBCXX-WINDOWS-FIXME // FILE_DEPENDENCIES: ../check-stdout.sh diff --git a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp --- a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp +++ b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp @@ -12,6 +12,8 @@ // char narrow(char_type c, char dfault) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp @@ -56,10 +56,6 @@ test t; test t2 = t; } - { - test t; - test t2 = t; - } { char g1, g2, g3, p1, p3; test t; @@ -67,6 +63,7 @@ t.setp(&p1, &p3); test t2 = t; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { wchar_t g1, g2, g3, p1, p3; test t; @@ -74,15 +71,22 @@ t.setp(&p1, &p3); test t2 = t; } + { + test t; + test t2 = t; + } +#endif std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test t; test t2 = t; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; test t2 = t; } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp @@ -42,19 +42,24 @@ test t; assert(t.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; assert(t.getloc().name() == "C"); } +#endif + std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test t; assert(t.getloc().name() == LOCALE_en_US_UTF_8); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; assert(t.getloc().name() == LOCALE_en_US_UTF_8); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp @@ -58,11 +58,6 @@ test t2; t2 = t; } - { - test t; - test t2; - t2 = t; - } { char g1, g2, g3, p1, p3; test t; @@ -71,6 +66,12 @@ test t2; t2 = t; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + test t; + test t2; + t2 = t; + } { wchar_t g1, g2, g3, p1, p3; test t; @@ -79,17 +80,20 @@ test t2; t2 = t; } +#endif std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test t; test t2; t2 = t; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; test t2; t2 = t; } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp @@ -67,11 +67,6 @@ test t2; t2.swap(t); } - { - test t; - test t2; - t2.swap(t); - } { char g1, g2, g3, p1, p3; test t; @@ -80,6 +75,12 @@ test t2; t2.swap(t); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + test t; + test t2; + t2.swap(t); + } { wchar_t g1, g2, g3, p1, p3; test t; @@ -88,17 +89,20 @@ test t2; t2.swap(t); } +#endif std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test t; test t2; t2.swap(t); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; test t2; t2.swap(t); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp @@ -51,12 +51,14 @@ t.setg(in, in+1, in+sizeof(in)/sizeof(in[0])); t.gbump(2); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; wchar_t in[] = L"ABCDE"; t.setg(in, in+1, in+sizeof(in)/sizeof(in[0])); t.gbump(3); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp @@ -42,11 +42,13 @@ char in[] = "ABC"; t.setg(in, in+1, in+sizeof(in)/sizeof(in[0])); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; wchar_t in[] = L"ABC"; t.setg(in, in+1, in+sizeof(in)/sizeof(in[0])); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp @@ -52,6 +52,7 @@ t.pbump(2); t.pbump(1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; wchar_t in[] = L"ABCDE"; @@ -59,6 +60,7 @@ t.pbump(3); t.pbump(1); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp @@ -42,11 +42,13 @@ char in[] = "ABC"; t.setp(in, in+sizeof(in)/sizeof(in[0])); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { test t; wchar_t in[] = L"ABC"; t.setp(in, in+sizeof(in)/sizeof(in[0])); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp --- a/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp +++ b/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp @@ -32,11 +32,13 @@ static_assert((std::is_same::pos_type>::value), ""); static_assert((std::is_same::off_type>::value), ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert((std::is_same::value), ""); static_assert((std::is_same >::value), ""); static_assert((std::is_same::int_type>::value), ""); static_assert((std::is_same::pos_type>::value), ""); static_assert((std::is_same::off_type>::value), ""); +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp @@ -37,6 +37,7 @@ ss0 >> i; assert(i == 321); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream ss0(L" 123 456"); std::wistringstream ss(L" 789 321"); @@ -54,6 +55,7 @@ ss0 >> i; assert(i == 321); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp @@ -51,6 +51,7 @@ s1 >> s; assert(s == "Dddddddddddddddddd"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream ss0(L" 123 456"); std::wistringstream ss; @@ -82,6 +83,7 @@ s1 >> s; assert(s == L"Dddddddddddddddddd"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp @@ -40,6 +40,7 @@ ss0 >> i; assert(i == 321); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream ss0(L" 123 456"); std::wistringstream ss(L" 789 321"); @@ -57,6 +58,7 @@ ss0 >> i; assert(i == 321); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp --- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp @@ -43,6 +43,7 @@ assert(ss.good()); assert(ss.str() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream ss; assert(ss.rdbuf() != 0); @@ -55,10 +56,13 @@ assert(ss.good()); assert(ss.str() == L""); } +#endif #if TEST_STD_VER >= 11 test(); +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS test(); +# endif #endif return 0; diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp @@ -32,6 +32,7 @@ ss >> i; assert(i == 456); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream ss0(L" 123 456"); std::wistringstream ss(std::move(ss0)); @@ -44,6 +45,7 @@ ss >> i; assert(i == 456); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp --- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp @@ -43,6 +43,7 @@ ss >> i; assert(i == 456); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream ss(L" 123 456"); assert(ss.rdbuf() != 0); @@ -65,6 +66,7 @@ ss >> i; assert(i == 456); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp --- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp @@ -37,6 +37,7 @@ ss >> i; assert(i == 789); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream ss(L" 123 456"); assert(ss.rdbuf() != 0); @@ -54,6 +55,7 @@ ss >> i; assert(i == 789); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp @@ -33,6 +33,7 @@ ss0 << i << ' ' << 567; assert(ss0.str() == "234 567"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream ss0(L" 123 456"); std::wostringstream ss; @@ -46,6 +47,7 @@ ss0 << i << ' ' << 567; assert(ss0.str() == L"234 567"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp @@ -31,6 +31,7 @@ ss << i << ' ' << 567; assert(ss.str() == "234 5676"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream ss0(L" 123 456"); std::wostringstream ss; @@ -42,6 +43,7 @@ ss << i << ' ' << 567; assert(ss.str() == L"234 5676"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp @@ -33,6 +33,7 @@ ss0 << i << ' ' << 567; assert(ss0.str() == "234 567"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream ss0(L" 123 456"); std::wostringstream ss; @@ -46,6 +47,7 @@ ss0 << i << ' ' << 567; assert(ss0.str() == L"234 567"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp --- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp @@ -43,6 +43,7 @@ assert(ss.good()); assert(ss.str() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream ss; assert(ss.rdbuf() != 0); @@ -55,10 +56,13 @@ assert(ss.good()); assert(ss.str() == L""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS #if TEST_STD_VER >= 11 test(); +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS test(); +# endif #endif return 0; diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp @@ -30,6 +30,7 @@ ss << i << ' ' << 567; assert(ss.str() == "234 5676"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream ss0(L" 123 456"); std::wostringstream ss(std::move(ss0)); @@ -40,6 +41,7 @@ ss << i << ' ' << 567; assert(ss.str() == L"234 5676"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp --- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp @@ -39,6 +39,7 @@ ss << i << ' ' << 567; assert(ss.str() == "234 5676"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream ss(L" 123 456"); assert(ss.rdbuf() != 0); @@ -57,6 +58,7 @@ ss << i << ' ' << 567; assert(ss.str() == L"234 5676"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp --- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp @@ -35,6 +35,7 @@ ss << "abc"; assert(ss.str() == "abc9"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream ss(L" 123 456"); assert(ss.rdbuf() != 0); @@ -50,6 +51,7 @@ ss << L"abc"; assert(ss.str() == L"abc9"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp @@ -41,6 +41,7 @@ assert(buf.str() == "testing"); assert(buf1.str() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf buf1(L"testing"); std::wstringbuf buf; @@ -62,6 +63,7 @@ assert(buf.str() == L"testing"); assert(buf1.str() == L""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp @@ -38,6 +38,7 @@ buf = move(buf1); assert(buf.str() == "testing"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf buf1(L"testing"); std::wstringbuf buf; @@ -56,6 +57,7 @@ buf = move(buf1); assert(buf.str() == L"testing"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp @@ -43,6 +43,7 @@ assert(buf.str() == "testing"); assert(buf1.str() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf buf1(L"testing"); std::wstringbuf buf; @@ -64,6 +65,7 @@ assert(buf.str() == L"testing"); assert(buf1.str() == L""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp @@ -44,18 +44,20 @@ std::stringbuf buf; assert(buf.str() == ""); } - { - std::wstringbuf buf; - assert(buf.str() == L""); - } { testbuf buf; buf.check(); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + std::wstringbuf buf; + assert(buf.str() == L""); + } { testbuf buf; buf.check(); } +#endif #if TEST_STD_VER >= 11 { diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp @@ -35,6 +35,7 @@ std::stringbuf buf(std::move(buf1)); assert(buf.str() == "testing"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf buf1(L"testing"); std::wstringbuf buf(std::move(buf1)); @@ -50,6 +51,7 @@ std::wstringbuf buf(std::move(buf1)); assert(buf.str() == L"testing"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp @@ -33,6 +33,7 @@ std::stringbuf buf("testing", std::ios_base::out); assert(buf.str() == "testing"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf buf(L"testing"); assert(buf.str() == L"testing"); @@ -45,6 +46,7 @@ std::wstringbuf buf(L"testing", std::ios_base::out); assert(buf.str() == L"testing"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp @@ -26,12 +26,14 @@ buf.str("another test"); assert(buf.str() == "another test"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf buf(L"testing"); assert(buf.str() == L"testing"); buf.str(L"another test"); assert(buf.str() == L"another test"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp @@ -68,6 +68,7 @@ assert(sb.sputc('1') == '1'); assert(sb.str() == "12345678901"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"abc"); assert(sb.sputc(L'1') == L'1'); @@ -93,6 +94,7 @@ assert(sb.sputc(L'1') == L'1'); assert(sb.str() == L"12345678901"); } +#endif { testbuf sb("abc", std::ios_base::app | std::ios_base::out); assert(sb.sputc('1') == '1'); diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp @@ -68,6 +68,7 @@ assert(sb.pbackfail(std::char_traits::eof()) == std::char_traits::eof()); assert(sb.str() == "133"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"123", std::ios_base::in); assert(sb.sgetc() == L'1'); @@ -95,6 +96,7 @@ assert(sb.pbackfail(std::char_traits::eof()) == std::char_traits::eof()); assert(sb.str() == L"133"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp @@ -105,6 +105,7 @@ assert(sb.sputc('c') == 'c'); assert(sb.str() == "0123456c89"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf sb(L"0123456789", std::ios_base::in); assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == -1); @@ -165,6 +166,7 @@ assert(sb.sputc(L'c') == L'c'); assert(sb.str() == L"0123456c89"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp @@ -48,6 +48,7 @@ assert(sb.sputc('3') == '3'); assert(sb.str() == "0123456789"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf sb(L"0123456789", std::ios_base::in); assert(sb.pubseekpos(3, std::ios_base::out) == -1); @@ -75,6 +76,7 @@ assert(sb.sputc(L'3') == L'3'); assert(sb.str() == L"0123456789"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp @@ -25,11 +25,13 @@ assert(sb.pubsetbuf(0, 0) == &sb); assert(sb.str() == "0123456789"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringbuf sb(L"0123456789"); assert(sb.pubsetbuf(0, 0) == &sb); assert(sb.str() == L"0123456789"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp @@ -50,6 +50,7 @@ assert(sb.underflow() == '4'); assert(sb.underflow() == '4'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { testbuf sb(L"123"); sb.pbump(3); @@ -68,6 +69,7 @@ assert(sb.underflow() == L'4'); assert(sb.underflow() == L'4'); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp @@ -43,6 +43,7 @@ assert(ss.good()); assert(ss.str() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringstream ss; assert(ss.rdbuf() != 0); @@ -55,10 +56,13 @@ assert(ss.good()); assert(ss.str() == L""); } +#endif #if TEST_STD_VER >= 11 test(); +# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS test(); +# endif #endif return 0; diff --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp @@ -34,6 +34,7 @@ ss << i << ' ' << 123; assert(ss.str() == "456 1236 "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringstream ss0(L" 123 456 "); std::wstringstream ss(std::move(ss0)); @@ -48,6 +49,7 @@ ss << i << ' ' << 123; assert(ss.str() == L"456 1236 "); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp @@ -44,6 +44,7 @@ ss << i << ' ' << 123; assert(ss.str() == "456 1236 "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringstream ss(L" 123 456 "); assert(ss.rdbuf() != 0); @@ -57,13 +58,14 @@ ss << i << ' ' << 123; assert(ss.str() == L"456 1236 "); } +#endif { // This is https://llvm.org/PR33727 typedef std::basic_string , NoDefaultAllocator > S; typedef std::basic_stringbuf, NoDefaultAllocator > SB; S s(NoDefaultAllocator(1)); SB sb(s); - // This test is not required by the standard, but *where else* could it get the allocator? + // This test is not required by the standard, but *where else* could it get the allocator? assert(sb.str().get_allocator() == s.get_allocator()); } diff --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp @@ -37,6 +37,7 @@ ss0 << i << ' ' << 123; assert(ss0.str() == "456 123"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringstream ss0(L" 123 456 "); std::wstringstream ss; @@ -54,6 +55,7 @@ ss0 << i << ' ' << 123; assert(ss0.str() == L"456 123"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp @@ -35,6 +35,7 @@ ss << i << ' ' << 123; assert(ss.str() == "456 1236 "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringstream ss0(L" 123 456 "); std::wstringstream ss; @@ -50,6 +51,7 @@ ss << i << ' ' << 123; assert(ss.str() == L"456 1236 "); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp @@ -40,6 +40,7 @@ ss0 << i << ' ' << 123; assert(ss0.str() == "456 123"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringstream ss0(L" 123 456 "); std::wstringstream ss; @@ -57,6 +58,7 @@ ss0 << i << ' ' << 123; assert(ss0.str() == L"456 123"); } +#endif return 0; } diff --git a/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp --- a/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp +++ b/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp @@ -40,6 +40,7 @@ ss << i << ' ' << 321; assert(ss.str() == "89 3219 "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstringstream ss(L" 123 456 "); assert(ss.rdbuf() != 0); @@ -60,6 +61,7 @@ ss << i << ' ' << 321; assert(ss.str() == L"89 3219 "); } +#endif { std::stringstream ss; ss.write("\xd1", 1); diff --git a/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp @@ -65,6 +65,7 @@ static_assert( std::is_trivially_destructible::value, ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::istream_iterator I2; // unsigned is trivially destructible #if TEST_STD_VER <= 14 @@ -82,6 +83,7 @@ static_assert( std::is_trivially_copy_constructible::value, ""); static_assert( std::is_trivially_destructible::value, ""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS typedef std::istream_iterator I3; // string is NOT trivially destructible static_assert(!std::is_trivially_copy_constructible::value, ""); diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp @@ -32,6 +32,8 @@ (void)it2; #endif } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::istreambuf_iterator T; T it; @@ -41,6 +43,7 @@ (void)it2; #endif } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp @@ -30,6 +30,7 @@ std::istreambuf_iterator i(inf); assert(i != std::istreambuf_iterator()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf; std::istreambuf_iterator i(inf); @@ -40,6 +41,7 @@ std::istreambuf_iterator i(inf); assert(i != std::istreambuf_iterator()); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp @@ -27,6 +27,7 @@ assert(i != std::istreambuf_iterator()); assert(*i == 'b'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf(L"abc"); std::istreambuf_iterator j(inf); @@ -34,6 +35,7 @@ assert(i != std::istreambuf_iterator()); assert(*i == L'b'); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp @@ -34,6 +34,7 @@ std::istreambuf_iterator i(inf.rdbuf()); assert(i != std::istreambuf_iterator()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::istreambuf_iterator i(nullptr); assert(i == std::istreambuf_iterator()); @@ -48,6 +49,7 @@ std::istreambuf_iterator i(inf.rdbuf()); assert(i != std::istreambuf_iterator()); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp @@ -59,6 +59,7 @@ assert( i5.equal(i4)); assert( i5.equal(i5)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf1(L"abc"); std::wistringstream inf2(L"def"); @@ -98,6 +99,7 @@ assert( i5.equal(i4)); assert( i5.equal(i5)); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp @@ -61,6 +61,7 @@ assert(!(i5 != i4)); assert(!(i5 != i5)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf1(L"abc"); std::wistringstream inf2(L"def"); @@ -100,6 +101,7 @@ assert(!(i5 != i4)); assert(!(i5 != i5)); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp @@ -29,6 +29,7 @@ ++i; assert(*i == 'c'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf(L"abc"); std::istreambuf_iterator i(inf); @@ -38,6 +39,7 @@ ++i; assert(*i == L'c'); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp @@ -61,6 +61,7 @@ assert( (i5 == i4)); assert( (i5 == i5)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf1(L"abc"); std::wistringstream inf2(L"def"); @@ -100,6 +101,7 @@ assert( (i5 == i4)); assert( (i5 == i5)); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp @@ -28,6 +28,7 @@ assert(*i++ == 'c'); assert(i == std::istreambuf_iterator()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf(L"abc"); std::istreambuf_iterator i(inf); @@ -36,6 +37,7 @@ assert(*i++ == L'c'); assert(i == std::istreambuf_iterator()); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp @@ -29,6 +29,7 @@ assert(*++i == 'c'); assert(++i == std::istreambuf_iterator()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf(L"abc"); std::istreambuf_iterator i(inf); @@ -37,6 +38,7 @@ assert(*++i == L'c'); assert(++i == std::istreambuf_iterator()); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp @@ -33,11 +33,13 @@ std::istreambuf_iterator i(inf); assert(*i++ == 'a'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream inf(L"abc"); std::istreambuf_iterator i(inf); assert(*i++ == L'a'); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp @@ -58,6 +58,7 @@ static_assert((std::is_trivially_destructible::value), "" ); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::istreambuf_iterator I2; #if TEST_STD_VER <= 14 @@ -78,6 +79,7 @@ static_assert((std::is_trivially_copy_constructible::value), "" ); static_assert((std::is_trivially_destructible::value), "" ); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp @@ -33,11 +33,13 @@ std::ostream_iterator i(outf, ", "); assert(outf.good()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream outf; std::ostream_iterator i(outf, L", "); assert(outf.good()); } +#endif { StringStream outf; std::ostream_iterator i(outf, ", "); diff --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp @@ -40,6 +40,7 @@ i = 2.4; assert(outf.str() == "2, "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream outf; std::ostream_iterator i(outf); @@ -52,6 +53,7 @@ i = 2.4; assert(outf.str() == L"2, "); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp @@ -54,6 +54,7 @@ static_assert((std::is_same::value), ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::ostream_iterator I2; #if TEST_STD_VER <= 14 @@ -73,6 +74,7 @@ static_assert((std::is_same >::value), ""); static_assert((std::is_same::value), ""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp @@ -25,11 +25,13 @@ std::ostreambuf_iterator i(outf); assert(!i.failed()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream outf; std::ostreambuf_iterator i(outf); assert(!i.failed()); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp @@ -25,11 +25,13 @@ std::ostreambuf_iterator i(outf.rdbuf()); assert(!i.failed()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream outf; std::ostreambuf_iterator i(outf.rdbuf()); assert(!i.failed()); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp @@ -29,6 +29,7 @@ i = 'b'; assert(outf.str() == "ab"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream outf; std::ostreambuf_iterator i(outf); @@ -37,6 +38,7 @@ i = L'b'; assert(outf.str() == L"ab"); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp @@ -26,12 +26,14 @@ std::ostreambuf_iterator& iref = *i; assert(&iref == &i); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream outf; std::ostreambuf_iterator i(outf); std::ostreambuf_iterator& iref = *i; assert(&iref == &i); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp @@ -35,12 +35,14 @@ i = 'a'; assert(i.failed()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { my_streambuf buf; std::ostreambuf_iterator i(&buf); i = L'a'; assert(i.failed()); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp @@ -29,6 +29,7 @@ std::ostreambuf_iterator& iref2 = i++; assert(&iref2 == &i); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream outf; std::ostreambuf_iterator i(outf); @@ -37,6 +38,7 @@ std::ostreambuf_iterator& iref2 = i++; assert(&iref2 == &i); } +#endif return 0; } diff --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp --- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp @@ -56,6 +56,7 @@ static_assert((std::is_same::value), ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::ostreambuf_iterator I2; #if TEST_STD_VER <= 14 @@ -76,6 +77,7 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp b/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp --- a/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp +++ b/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp @@ -10,9 +10,7 @@ #include #include -#include #include -#include #include #include #include @@ -20,6 +18,11 @@ #include "test_macros.h" +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# include +# include +#endif + int main(int, char**) { // typedef std::int8_t @@ -239,6 +242,7 @@ // SIZE_MAX assert(SIZE_MAX == std::numeric_limits::max()); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS // WCHAR_MIN assert(WCHAR_MIN == std::numeric_limits::min()); @@ -250,6 +254,7 @@ // WINT_MAX assert(WINT_MAX == std::numeric_limits::max()); +#endif #ifndef INT8_C #error INT8_C not defined diff --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp --- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp @@ -12,12 +12,15 @@ #include #include -#include #include #include #include "test_macros.h" +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# include +#endif + template void test(T expected) @@ -38,7 +41,9 @@ test(CHAR_MIN); test(SCHAR_MIN); test(0); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(WCHAR_MIN); +#endif #if TEST_STD_VER > 17 && defined(__cpp_char8_t) test(0); #endif diff --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp --- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp @@ -12,12 +12,15 @@ #include #include -#include #include #include #include "test_macros.h" +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# include +#endif + template void test(T expected) @@ -38,7 +41,9 @@ test(CHAR_MAX); test(SCHAR_MAX); test(UCHAR_MAX); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(WCHAR_MAX); +#endif #if TEST_STD_VER > 17 && defined(__cpp_char8_t) test(UCHAR_MAX); // ?? #endif diff --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp --- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp @@ -12,12 +12,15 @@ #include #include -#include #include #include #include "test_macros.h" +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# include +#endif + template void test(T expected) @@ -38,7 +41,9 @@ test(CHAR_MIN); test(SCHAR_MIN); test(0); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(WCHAR_MIN); +#endif #if TEST_STD_VER > 17 && defined(__cpp_char8_t) test(0); #endif diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp @@ -45,6 +45,7 @@ assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const std::collate& f = std::use_facet >(l); std::wstring s2(L"aaaaaaA"); @@ -52,6 +53,7 @@ assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } +#endif } { std::locale l("C"); @@ -62,6 +64,7 @@ assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const std::collate& f = std::use_facet >(l); std::wstring s2(L"aaaaaaA"); @@ -69,6 +72,7 @@ assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } +#endif } return 0; diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp @@ -36,6 +36,7 @@ assert(f.hash(x1.data(), x1.data() + x1.size()) != f.hash(x2.data(), x2.data() + x2.size())); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring x1(L"1234"); std::wstring x2(L"12345"); @@ -43,6 +44,7 @@ assert(f.hash(x1.data(), x1.data() + x1.size()) != f.hash(x2.data(), x2.data() + x2.size())); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp @@ -35,11 +35,13 @@ const std::collate& f = std::use_facet >(l); assert(f.transform(x.data(), x.data() + x.size()) != x); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring x(L"1234"); const std::collate& f = std::use_facet >(l); assert(f.transform(x.data(), x.data() + x.size()) != x); } +#endif } { std::locale l("C"); @@ -48,11 +50,13 @@ const std::collate& f = std::use_facet >(l); assert(f.transform(x.data(), x.data() + x.size()) == x); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring x(L"1234"); const std::collate& f = std::use_facet >(l); assert(f.transform(x.data(), x.data() + x.size()) == x); } +#endif } return 0; diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp @@ -39,11 +39,13 @@ assert(&std::use_facet >(l) == &std::use_facet >(l)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { assert(std::has_facet >(l)); assert(&std::use_facet >(l) == &std::use_facet >(l)); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp @@ -50,6 +50,8 @@ assert(my_facet::count == 1); } assert(my_facet::count == 0); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale l(std::locale::classic(), new my_facet); assert(my_facet::count == 1); @@ -65,6 +67,7 @@ assert(my_facet::count == 1); } assert(my_facet::count == 0); +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp @@ -37,6 +37,7 @@ assert(f.compare(ib+1, ib+3, ia, ia+sa) == 1); assert(f.compare(ia, ia+3, ib, ib+3) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const wchar_t ia[] = L"1234"; const unsigned sa = sizeof(ia)/sizeof(ia[0]); @@ -50,6 +51,7 @@ assert(f.compare(ib+1, ib+3, ia, ia+sa) == 1); assert(f.compare(ia, ia+3, ib, ib+3) == 0); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp @@ -33,6 +33,7 @@ assert(f.hash(x1.data(), x1.data() + x1.size()) != f.hash(x2.data(), x2.data() + x2.size())); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring x1(L"1234"); std::wstring x2(L"12345"); @@ -40,6 +41,7 @@ assert(f.hash(x1.data(), x1.data() + x1.size()) != f.hash(x2.data(), x2.data() + x2.size())); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp @@ -26,11 +26,13 @@ const std::collate& f = std::use_facet >(l); assert(f.transform(x.data(), x.data() + x.size()) == x); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring x(L"1234"); const std::collate& f = std::use_facet >(l); assert(f.transform(x.data(), x.data() + x.size()) == x); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp @@ -38,6 +38,7 @@ static_assert((std::is_same::string_type, std::string>::value), ""); static_assert((std::is_base_of >::value), ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { assert(std::has_facet >(l)); const std::collate& f = std::use_facet >(l); @@ -49,6 +50,7 @@ static_assert((std::is_same::string_type, std::wstring>::value), ""); static_assert((std::is_base_of >::value), ""); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp @@ -15,6 +15,8 @@ // explicit codecvt_byname(const char* nm, size_t refs = 0); // explicit codecvt_byname(const string& nm, size_t refs = 0); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp @@ -12,6 +12,8 @@ // explicit codecvt(size_t refs = 0); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp @@ -12,6 +12,8 @@ // bool always_noconv() const throw(); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp @@ -12,6 +12,8 @@ // int encoding() const throw(); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp @@ -14,6 +14,8 @@ // const externT* from, const externT* from_end, const externT*& from_next, // internT* to, internT* to_end, internT*& to_next) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp @@ -12,6 +12,8 @@ // int length(stateT& state, const externT* from, const externT* from_end, size_t max) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp @@ -12,6 +12,8 @@ // int max_length() const throw(); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp @@ -14,6 +14,8 @@ // const internT* from, const internT* from_end, const internT*& from_next, // externT* to, externT* to_end, externT*& to_next) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp @@ -13,6 +13,8 @@ // result unshift(stateT& state, // externT* to, externT* to_end, externT*& to_next) const; +// XFAIL: libcpp-has-no-wide-characters + // This is pretty much just an "are you breathing" test #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp @@ -20,6 +20,8 @@ // ... // }; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp @@ -14,6 +14,7 @@ // REQUIRES: locale.en_US.UTF-8 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp @@ -14,6 +14,7 @@ // REQUIRES: locale.en_US.UTF-8 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp @@ -20,37 +20,42 @@ int main(int, char**) { + std::locale l("C"); { - std::locale l("C"); - { - typedef std::ctype WF; - const WF& wf = std::use_facet(l); - typedef std::ctype CF; - const CF& cf = std::use_facet(l); - - // The ctype masks in Newlib don't form a proper bitmask because - // the mask is only 8 bits wide, and there are more than 8 mask - // kinds. This means that the mask for alpha is (_U | _L), which - // is tricky to match in the do_is implementation because in - // [22.4.1.1.2 2] the standard specifies that the match code behaves - // like (m & M) != 0, but following this exactly would give false - // positives for characters that are both 'upper' and 'alpha', but - // not 'lower', for example. - assert( wf.is(WF::upper, L'A')); - assert( cf.is(CF::upper, 'A')); - assert(!wf.is(WF::lower, L'A')); - assert(!cf.is(CF::lower, 'A')); - assert( wf.is(WF::alpha, L'A')); - assert( cf.is(CF::alpha, 'A')); - - assert(!wf.is(WF::upper, L'a')); - assert(!cf.is(CF::upper, 'a')); - assert( wf.is(WF::lower, L'a')); - assert( cf.is(CF::lower, 'a')); - assert( wf.is(WF::alpha, L'a')); - assert( cf.is(CF::alpha, 'a')); - } + typedef std::ctype CF; + const CF& cf = std::use_facet(l); + + // NOTE: + // The ctype masks in Newlib don't form a proper bitmask because + // the mask is only 8 bits wide, and there are more than 8 mask + // kinds. This means that the mask for alpha is (_U | _L), which + // is tricky to match in the do_is implementation because in + // [22.4.1.1.2 2] the standard specifies that the match code behaves + // like (m & M) != 0, but following this exactly would give false + // positives for characters that are both 'upper' and 'alpha', but + // not 'lower', for example. + assert( cf.is(CF::upper, 'A')); + assert(!cf.is(CF::lower, 'A')); + assert( cf.is(CF::alpha, 'A')); + + assert(!cf.is(CF::upper, 'a')); + assert( cf.is(CF::lower, 'a')); + assert( cf.is(CF::alpha, 'a')); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + typedef std::ctype WF; + const WF& wf = std::use_facet(l); + + assert( wf.is(WF::upper, L'A')); + assert(!wf.is(WF::lower, L'A')); + assert( wf.is(WF::alpha, L'A')); + + assert(!wf.is(WF::upper, L'a')); + assert( wf.is(WF::lower, L'a')); + assert( wf.is(WF::alpha, L'a')); + } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp @@ -9,6 +9,7 @@ // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_CA.ISO8859-1 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters // diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp @@ -9,6 +9,7 @@ // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_CA.ISO8859-1 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters // diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp @@ -14,6 +14,7 @@ // REQUIRES: locale.en_US.UTF-8 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp @@ -14,6 +14,7 @@ // REQUIRES: locale.en_US.UTF-8 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp @@ -55,6 +55,7 @@ assert(f.tolower('\xFA') == '\xFA'); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale l; { @@ -89,6 +90,7 @@ assert(f.tolower(L'\xFA') == L'\xFA'); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp @@ -59,6 +59,7 @@ assert(in[6] == '1'); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale l; { @@ -95,6 +96,7 @@ assert(in[6] == L'1'); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp @@ -57,6 +57,7 @@ assert(f.toupper('\xFA') == '\xFA'); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale l; { @@ -91,6 +92,7 @@ assert(f.toupper(L'\xFA') == L'\xFA'); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp @@ -59,6 +59,7 @@ assert(in[6] == '1'); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale l; { @@ -95,6 +96,7 @@ assert(in[6] == L'1'); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp @@ -38,11 +38,13 @@ assert(&std::use_facet >(l) == &std::use_facet >(l)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { assert(std::has_facet >(l)); assert(&std::use_facet >(l) == &std::use_facet >(l)); } +#endif } { std::locale l("C"); @@ -51,11 +53,13 @@ assert(&std::use_facet >(l) == &std::use_facet >(l)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { assert(std::has_facet >(l)); assert(&std::use_facet >(l) == &std::use_facet >(l)); } +#endif } return 0; diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp @@ -8,6 +8,7 @@ // REQUIRES: locale.en_US.UTF-8 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters // diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp @@ -8,6 +8,7 @@ // REQUIRES: locale.en_US.UTF-8 // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters // diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp @@ -12,6 +12,8 @@ // explicit ctype(size_t refs = 0); +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp @@ -12,6 +12,8 @@ // bool is(mask m, charT c) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp @@ -12,6 +12,8 @@ // const charT* do_is(const charT* low, const charT* high, mask* vec) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp @@ -12,6 +12,8 @@ // char narrow(charT c, char dfault) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp @@ -12,6 +12,8 @@ // const charT* narrow(const charT* low, const charT*, char dfault, char* to) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp @@ -12,6 +12,8 @@ // const charT* scan_is(mask m, const charT* low, const charT* high) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp @@ -12,6 +12,8 @@ // const charT* scan_not(mask m, const charT* low, const charT* high) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp @@ -12,6 +12,8 @@ // charT tolower(charT) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp @@ -12,6 +12,8 @@ // const charT* tolower(charT* low, const charT* high) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp @@ -12,6 +12,8 @@ // charT toupper(charT) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp @@ -12,6 +12,8 @@ // const charT* toupper(charT* low, const charT* high) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp @@ -12,6 +12,8 @@ // charT widen(char c) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp @@ -12,6 +12,8 @@ // const char* widen(const char* low, const char* high, charT* to) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp @@ -17,6 +17,8 @@ // typedef CharT char_type; // }; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp @@ -26,12 +26,15 @@ { static_assert((std::is_base_of >::value), ""); static_assert((std::is_base_of >::value), ""); + static_assert((std::is_same::char_type, char>::value), ""); + static_assert((std::is_same::string_type, std::string>::value), ""); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert((std::is_base_of >::value), ""); static_assert((std::is_base_of >::value), ""); - static_assert((std::is_same::char_type, char>::value), ""); static_assert((std::is_same::char_type, wchar_t>::value), ""); - static_assert((std::is_same::string_type, std::string>::value), ""); static_assert((std::is_same::string_type, std::wstring>::value), ""); +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp @@ -35,6 +35,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_get > Fw; class my_facetw @@ -44,6 +45,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -53,10 +55,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -389,6 +393,7 @@ assert(err == std::ios_base::failbit); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -721,6 +726,7 @@ assert(err == std::ios_base::failbit); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { // test for err const my_facet f(1); diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp @@ -41,6 +41,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_get > Fw; class my_facetw @@ -77,6 +78,7 @@ return in; #endif } +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -86,10 +88,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -423,6 +427,7 @@ assert(ex == 123456789); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -755,6 +760,7 @@ assert(ex == 123456789); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp @@ -58,6 +58,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_get > Fw; class my_facetw @@ -67,6 +68,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -76,10 +78,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -422,6 +426,7 @@ assert(ex == -123456789); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -764,6 +769,7 @@ assert(ex == -123456789); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp @@ -42,6 +42,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_get > Fw; class my_facetw @@ -51,6 +52,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -60,10 +62,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -396,6 +400,7 @@ assert(err == std::ios_base::failbit); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -728,6 +733,7 @@ assert(err == std::ios_base::failbit); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp @@ -35,6 +35,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_get > Fw; class my_facetw @@ -44,6 +45,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -53,10 +55,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -393,6 +397,7 @@ assert(ex == ""); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -729,6 +734,7 @@ assert(ex == L""); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { // test for err const my_facet f(1); diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp @@ -25,13 +25,16 @@ int main(int, char**) { static_assert((std::is_base_of >::value), ""); - static_assert((std::is_base_of >::value), ""); static_assert((std::is_same::char_type, char>::value), ""); - static_assert((std::is_same::char_type, wchar_t>::value), ""); static_assert((std::is_same::iter_type, std::istreambuf_iterator >::value), ""); - static_assert((std::is_same::iter_type, std::istreambuf_iterator >::value), ""); static_assert((std::is_same::string_type, std::string>::value), ""); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + static_assert((std::is_base_of >::value), ""); + static_assert((std::is_same::char_type, wchar_t>::value), ""); + static_assert((std::is_same::iter_type, std::istreambuf_iterator >::value), ""); static_assert((std::is_same::string_type, std::wstring>::value), ""); +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp @@ -35,6 +35,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_put > Fw; class my_facetw @@ -44,6 +45,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -53,10 +55,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -273,8 +277,8 @@ assert(ios.width() == 0); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { - const my_facetw f(1); // wchar_t, national noshowbase(ios); @@ -492,6 +496,7 @@ assert(ios.width() == 0); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp @@ -41,6 +41,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_put > Fw; class my_facetw @@ -79,6 +80,7 @@ return in; #endif } +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -88,10 +90,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -308,6 +312,7 @@ assert(ios.width() == 0); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -526,6 +531,7 @@ assert(ios.width() == 0); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp @@ -58,6 +58,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_put > Fw; class my_facetw @@ -67,6 +68,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -76,10 +78,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -116,7 +120,7 @@ std::string ex(str, iter.base()); assert(ex == "-1 234 567,89 "); } -#endif +#endif // APPLE_FIXME { // zero, showbase long double v = 0; showbase(ios); @@ -262,7 +266,7 @@ std::string ex(str, iter.base()); assert(ex == "-1 234 567,89 RUB "); } -#endif +#endif // APPLE_FIXME { // negative, showbase, left long double v = -123456789; showbase(ios); @@ -300,8 +304,9 @@ assert(ex == " -1 234 567,89 RUB "); assert(ios.width() == 0); } -#endif +#endif // APPLE_FIXME } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -340,7 +345,7 @@ std::wstring ex(str, iter.base()); assert(ex == L"-1 234 567,89 "); } -#endif +#endif // APPLE_FIXME { // zero, showbase long double v = 0; showbase(ios); @@ -486,7 +491,7 @@ std::wstring ex(str, iter.base()); assert(ex == L"-1 234 567,89 RUB "); } -#endif +#endif // APPLE_FIXME { // negative, showbase, left long double v = -123456789; showbase(ios); @@ -524,8 +529,9 @@ assert(ex == L" -1 234 567,89 RUB "); assert(ios.width() == 0); } -#endif +#endif // APPLE_FIXME } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp @@ -42,6 +42,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_put > Fw; class my_facetw @@ -51,6 +52,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -60,10 +62,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -280,6 +284,7 @@ assert(ios.width() == 0); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { const my_facetw f(1); // wchar_t, national @@ -498,6 +503,7 @@ assert(ios.width() == 0); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp @@ -36,6 +36,7 @@ : Fn(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS typedef std::money_put > Fw; class my_facetw @@ -45,6 +46,7 @@ explicit my_facetw(std::size_t refs = 0) : Fw(refs) {} }; +#endif int main(int, char**) { @@ -54,10 +56,12 @@ new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); ios.imbue(std::locale(ios.getloc(), new std::moneypunct_byname(loc_name))); +#endif { const my_facet f(1); // char, national @@ -274,8 +278,8 @@ assert(ios.width() == 0); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { - const my_facetw f(1); // wchar_t, national noshowbase(ios); @@ -493,6 +497,7 @@ assert(ios.width() == 0); } } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp @@ -25,13 +25,16 @@ int main(int, char**) { static_assert((std::is_base_of >::value), ""); - static_assert((std::is_base_of >::value), ""); static_assert((std::is_same::char_type, char>::value), ""); - static_assert((std::is_same::char_type, wchar_t>::value), ""); static_assert((std::is_same::iter_type, std::ostreambuf_iterator >::value), ""); - static_assert((std::is_same::iter_type, std::ostreambuf_iterator >::value), ""); static_assert((std::is_same::string_type, std::string>::value), ""); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + static_assert((std::is_base_of >::value), ""); + static_assert((std::is_same::char_type, wchar_t>::value), ""); + static_assert((std::is_same::iter_type, std::ostreambuf_iterator >::value), ""); static_assert((std::is_same::string_type, std::wstring>::value), ""); +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp @@ -47,6 +47,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -62,6 +63,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -73,6 +75,7 @@ Fnt f("C", 1); assert(f.curr_symbol() == std::string()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); assert(f.curr_symbol() == std::wstring()); @@ -81,6 +84,7 @@ Fwt f("C", 1); assert(f.curr_symbol() == std::wstring()); } +#endif { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -90,6 +94,7 @@ Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.curr_symbol() == "USD "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); assert(f.curr_symbol() == L"$"); @@ -98,6 +103,7 @@ Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.curr_symbol() == L"USD "); } +#endif { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -107,6 +113,7 @@ Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.curr_symbol() == " EUR"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); assert(f.curr_symbol() == L" \u20ac"); @@ -115,6 +122,7 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.curr_symbol() == L" EUR"); } +#endif { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -134,6 +142,7 @@ Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.curr_symbol() == " RUB"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); #if defined(_CS_GNU_LIBC_VERSION) @@ -150,6 +159,7 @@ Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.curr_symbol() == L" RUB"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -159,6 +169,7 @@ Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.curr_symbol() == "CNY "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); assert(f.curr_symbol() == L"\xFFE5"); @@ -167,6 +178,7 @@ Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.curr_symbol() == L"CNY "); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp @@ -40,6 +40,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -55,6 +56,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -66,6 +68,7 @@ Fnt f("C", 1); assert(f.decimal_point() == std::numeric_limits::max()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); assert(f.decimal_point() == std::numeric_limits::max()); @@ -74,6 +77,7 @@ Fwt f("C", 1); assert(f.decimal_point() == std::numeric_limits::max()); } +#endif { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -83,6 +87,7 @@ Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.decimal_point() == '.'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); assert(f.decimal_point() == L'.'); @@ -91,6 +96,7 @@ Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.decimal_point() == L'.'); } +#endif { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -100,6 +106,7 @@ Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.decimal_point() == ','); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); assert(f.decimal_point() == L','); @@ -108,14 +115,20 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.decimal_point() == L','); } +#endif + // GLIBC 2.23 uses '.' as the decimal point while other C libraries use ',' // GLIBC 2.27 corrects this #if defined(_CS_GNU_LIBC_VERSION) const char sep = glibc_version_less_than("2.27") ? '.' : ','; +# ifndef TEST_HAS_NO_WIDE_CHARACTERS const wchar_t wsep = glibc_version_less_than("2.27") ? L'.' : L','; +# endif #else const char sep = ','; +# ifndef TEST_HAS_NO_WIDE_CHARACTERS const wchar_t wsep = L','; +# endif #endif { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -125,6 +138,7 @@ Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.decimal_point() == sep); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); assert(f.decimal_point() == wsep); @@ -133,6 +147,7 @@ Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.decimal_point() == wsep); } +#endif { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -142,6 +157,7 @@ Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.decimal_point() == '.'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); assert(f.decimal_point() == L'.'); @@ -150,6 +166,7 @@ Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.decimal_point() == L'.'); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp @@ -40,6 +40,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -55,6 +56,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -66,6 +68,7 @@ Fnt f("C", 1); assert(f.frac_digits() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); assert(f.frac_digits() == 0); @@ -74,6 +77,7 @@ Fwt f("C", 1); assert(f.frac_digits() == 0); } +#endif { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -83,6 +87,7 @@ Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.frac_digits() == 2); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); assert(f.frac_digits() == 2); @@ -91,6 +96,7 @@ Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.frac_digits() == 2); } +#endif { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -100,6 +106,7 @@ Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.frac_digits() == 2); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); assert(f.frac_digits() == 2); @@ -108,6 +115,7 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.frac_digits() == 2); } +#endif { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -117,6 +125,7 @@ Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.frac_digits() == 2); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); assert(f.frac_digits() == 2); @@ -125,6 +134,7 @@ Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.frac_digits() == 2); } +#endif { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -134,6 +144,7 @@ Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.frac_digits() == 2); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); assert(f.frac_digits() == 2); @@ -142,6 +153,7 @@ Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.frac_digits() == 2); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp @@ -47,6 +47,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -62,6 +63,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -76,6 +78,7 @@ Fnt f("C", 1); assert(f.grouping() == s || f.grouping() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); assert(f.grouping() == s || f.grouping() == ""); @@ -84,6 +87,7 @@ Fwt f("C", 1); assert(f.grouping() == s || f.grouping() == ""); } +#endif { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -93,6 +97,7 @@ Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.grouping() == "\3\3"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); assert(f.grouping() == "\3\3"); @@ -101,6 +106,7 @@ Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.grouping() == "\3\3"); } +#endif { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -110,6 +116,7 @@ Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.grouping() == "\3"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); assert(f.grouping() == "\3"); @@ -118,6 +125,7 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.grouping() == "\3"); } +#endif { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -127,6 +135,7 @@ Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.grouping() == "\3\3"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); assert(f.grouping() == "\3\3"); @@ -135,6 +144,7 @@ Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.grouping() == "\3\3"); } +#endif { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -144,6 +154,7 @@ Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.grouping() == "\3"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); assert(f.grouping() == "\3"); @@ -152,6 +163,7 @@ Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.grouping() == "\3"); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp @@ -47,6 +47,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -62,6 +63,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -81,6 +83,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); std::money_base::pattern p = f.neg_format(); @@ -97,6 +100,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -114,6 +118,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); std::money_base::pattern p = f.neg_format(); @@ -130,6 +135,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -147,6 +153,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); std::money_base::pattern p = f.neg_format(); @@ -163,6 +170,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -180,6 +188,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); std::money_base::pattern p = f.neg_format(); @@ -196,6 +205,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -213,6 +223,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); std::money_base::pattern p = f.neg_format(); @@ -229,6 +240,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp @@ -42,6 +42,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -57,6 +58,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -68,6 +70,7 @@ Fnt f("C", 1); assert(f.negative_sign() == std::string()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); assert(f.negative_sign() == std::wstring()); @@ -76,6 +79,7 @@ Fwt f("C", 1); assert(f.negative_sign() == std::wstring()); } +#endif { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -85,6 +89,7 @@ Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.negative_sign() == "-"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); assert(f.negative_sign() == L"-"); @@ -93,6 +98,7 @@ Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.negative_sign() == L"-"); } +#endif { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -102,6 +108,7 @@ Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.negative_sign() == "-"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); assert(f.negative_sign() == L"-"); @@ -110,6 +117,7 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.negative_sign() == L"-"); } +#endif { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -119,6 +127,7 @@ Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.negative_sign() == "-"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); assert(f.negative_sign() == L"-"); @@ -127,6 +136,7 @@ Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.negative_sign() == L"-"); } +#endif { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -136,6 +146,7 @@ Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.negative_sign() == "-"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); assert(f.negative_sign() == L"-"); @@ -144,6 +155,7 @@ Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.negative_sign() == L"-"); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp @@ -47,6 +47,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -62,6 +63,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -81,6 +83,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); std::money_base::pattern p = f.pos_format(); @@ -97,6 +100,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -114,6 +118,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); std::money_base::pattern p = f.pos_format(); @@ -130,6 +135,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -147,6 +153,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); std::money_base::pattern p = f.pos_format(); @@ -163,6 +170,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -180,6 +188,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); std::money_base::pattern p = f.pos_format(); @@ -196,6 +205,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::symbol); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -213,6 +223,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); std::money_base::pattern p = f.pos_format(); @@ -229,6 +240,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp @@ -40,6 +40,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -55,6 +56,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -66,6 +68,7 @@ Fnt f("C", 1); assert(f.positive_sign() == std::string()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); assert(f.positive_sign() == std::wstring()); @@ -74,6 +77,7 @@ Fwt f("C", 1); assert(f.positive_sign() == std::wstring()); } +#endif { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -83,6 +87,7 @@ Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.positive_sign() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); assert(f.positive_sign() == L""); @@ -91,6 +96,7 @@ Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.positive_sign() == L""); } +#endif { Fnf f(LOCALE_fr_FR_UTF_8, 1); @@ -100,6 +106,7 @@ Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.positive_sign() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_fr_FR_UTF_8, 1); assert(f.positive_sign() == L""); @@ -108,6 +115,7 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.positive_sign() == L""); } +#endif { Fnf f(LOCALE_ru_RU_UTF_8, 1); @@ -117,6 +125,7 @@ Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.positive_sign() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_ru_RU_UTF_8, 1); assert(f.positive_sign() == L""); @@ -125,6 +134,7 @@ Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.positive_sign() == L""); } +#endif { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -134,6 +144,7 @@ Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.positive_sign() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); assert(f.positive_sign() == L""); @@ -142,6 +153,7 @@ Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.positive_sign() == L""); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -45,6 +45,7 @@ : std::moneypunct_byname(nm, refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct_byname { @@ -60,6 +61,7 @@ explicit Fwt(const std::string& nm, std::size_t refs = 0) : std::moneypunct_byname(nm, refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -71,6 +73,7 @@ Fnt f("C", 1); assert(f.thousands_sep() == std::numeric_limits::max()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f("C", 1); assert(f.thousands_sep() == std::numeric_limits::max()); @@ -79,6 +82,7 @@ Fwt f("C", 1); assert(f.thousands_sep() == std::numeric_limits::max()); } +#endif { Fnf f(LOCALE_en_US_UTF_8, 1); @@ -88,6 +92,7 @@ Fnt f(LOCALE_en_US_UTF_8, 1); assert(f.thousands_sep() == ','); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_en_US_UTF_8, 1); assert(f.thousands_sep() == L','); @@ -96,6 +101,7 @@ Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.thousands_sep() == L','); } +#endif { Fnf f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == ' '); @@ -104,7 +110,8 @@ Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == ' '); } -// The below tests work around GLIBC's use of U202F as mon_thousands_sep. + // The below tests work around GLIBC's use of U202F as mon_thousands_sep. +#ifndef TEST_HAS_NO_WIDE_CHARACTERS #if defined(_CS_GNU_LIBC_VERSION) const wchar_t fr_sep = glibc_version_less_than("2.27") ? L' ' : L'\u202F'; #else @@ -118,19 +125,8 @@ Fwt f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == fr_sep); } -// The below tests work around GLIBC's use of U00A0 as mon_thousands_sep -// and U002E as mon_decimal_point. -// TODO: Fix thousands_sep for 'char'. -// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 -#if defined(_CS_GNU_LIBC_VERSION) - const char sep = ' '; - // FIXME libc++ specifically works around \u00A0 by translating it into - // a regular space. - const wchar_t wsep = glibc_version_less_than("2.27") ? L'\u00A0' : L'\u202F'; -#else +#endif // TEST_HAS_NO_WIDE_CHARACTERS const char sep = ' '; - const wchar_t wsep = L' '; -#endif { Fnf f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == sep); @@ -139,6 +135,18 @@ Fnt f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == sep); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + // The below tests work around GLIBC's use of U00A0 as mon_thousands_sep + // and U002E as mon_decimal_point. + // TODO: Fix thousands_sep for 'char'. + // related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006 +# if defined(_CS_GNU_LIBC_VERSION) + // FIXME libc++ specifically works around \u00A0 by translating it into + // a regular space. + const wchar_t wsep = glibc_version_less_than("2.27") ? L'\u00A0' : L'\u202F'; +# else + const wchar_t wsep = L' '; +# endif { Fwf f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == wsep); @@ -147,6 +155,7 @@ Fwt f(LOCALE_ru_RU_UTF_8, 1); assert(f.thousands_sep() == wsep); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { Fnf f(LOCALE_zh_CN_UTF_8, 1); @@ -156,6 +165,7 @@ Fnt f(LOCALE_zh_CN_UTF_8, 1); assert(f.thousands_sep() == ','); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(LOCALE_zh_CN_UTF_8, 1); assert(f.thousands_sep() == L','); @@ -164,6 +174,7 @@ Fwt f(LOCALE_zh_CN_UTF_8, 1); assert(f.thousands_sep() == L','); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp @@ -39,6 +39,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -54,6 +55,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -65,6 +67,7 @@ Fnt f(1); assert(f.curr_symbol() == std::string()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); assert(f.curr_symbol() == std::wstring()); @@ -73,6 +76,7 @@ Fwt f(1); assert(f.curr_symbol() == std::wstring()); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp @@ -39,6 +39,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -54,6 +55,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -65,6 +67,7 @@ Fnt f(1); assert(f.decimal_point() == std::numeric_limits::max()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); assert(f.decimal_point() == std::numeric_limits::max()); @@ -73,6 +76,7 @@ Fwt f(1); assert(f.decimal_point() == std::numeric_limits::max()); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp @@ -39,6 +39,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -54,6 +55,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -65,6 +67,7 @@ Fnt f(1); assert(f.frac_digits() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); assert(f.frac_digits() == 0); @@ -73,6 +76,7 @@ Fwt f(1); assert(f.frac_digits() == 0); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp @@ -39,6 +39,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -54,6 +55,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -65,6 +67,7 @@ Fnt f(1); assert(f.grouping() == std::string()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); assert(f.grouping() == std::string()); @@ -73,6 +76,7 @@ Fwt f(1); assert(f.grouping() == std::string()); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp @@ -36,6 +36,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -51,6 +52,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -70,6 +72,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); std::money_base::pattern p = f.neg_format(); @@ -86,6 +89,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp @@ -40,6 +40,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -55,6 +56,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -66,6 +68,7 @@ Fnt f(1); assert(f.negative_sign() == "-"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); assert(f.negative_sign() == L"-"); @@ -74,6 +77,7 @@ Fwt f(1); assert(f.negative_sign() == L"-"); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp @@ -36,6 +36,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -51,6 +52,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -70,6 +72,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); std::money_base::pattern p = f.pos_format(); @@ -86,6 +89,7 @@ assert(p.field[2] == std::money_base::none); assert(p.field[3] == std::money_base::value); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp @@ -39,6 +39,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -54,6 +55,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -65,6 +67,7 @@ Fnt f(1); assert(f.positive_sign() == std::string()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); assert(f.positive_sign() == std::wstring()); @@ -73,6 +76,7 @@ Fwt f(1); assert(f.positive_sign() == std::wstring()); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp @@ -39,6 +39,7 @@ : std::moneypunct(refs) {} }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS class Fwf : public std::moneypunct { @@ -54,6 +55,7 @@ explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -65,6 +67,7 @@ Fnt f(1); assert(f.thousands_sep() == std::numeric_limits::max()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { Fwf f(1); assert(f.thousands_sep() == std::numeric_limits::max()); @@ -73,6 +76,7 @@ Fwt f(1); assert(f.thousands_sep() == std::numeric_limits::max()); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp @@ -29,18 +29,20 @@ int main(int, char**) { static_assert((std::is_base_of >::value), ""); - static_assert((std::is_base_of >::value), ""); static_assert((std::is_base_of >::value), ""); - static_assert((std::is_base_of >::value), ""); static_assert((std::is_same::char_type, char>::value), ""); - static_assert((std::is_same::char_type, wchar_t>::value), ""); static_assert((std::is_same::string_type, std::string>::value), ""); - static_assert((std::is_same::string_type, std::wstring>::value), ""); - test(std::moneypunct::intl); test(std::moneypunct::intl); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + static_assert((std::is_base_of >::value), ""); + static_assert((std::is_base_of >::value), ""); + static_assert((std::is_same::char_type, wchar_t>::value), ""); + static_assert((std::is_same::string_type, std::wstring>::value), ""); test(std::moneypunct::intl); test(std::moneypunct::intl); +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp @@ -25,11 +25,14 @@ int main(int, char**) { static_assert((std::is_base_of >::value), ""); - static_assert((std::is_base_of >::value), ""); static_assert((std::is_same::char_type, char>::value), ""); - static_assert((std::is_same::char_type, wchar_t>::value), ""); static_assert((std::is_same::iter_type, std::ostreambuf_iterator >::value), ""); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + static_assert((std::is_base_of >::value), ""); + static_assert((std::is_same::char_type, wchar_t>::value), ""); static_assert((std::is_same::iter_type, std::ostreambuf_iterator >::value), ""); +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.ru_RU.UTF-8 diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp @@ -9,6 +9,8 @@ // NetBSD does not support LC_TIME at the moment // XFAIL: netbsd +// XFAIL: libcpp-has-no-wide-characters + // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.ru_RU.UTF-8 diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp @@ -9,6 +9,7 @@ // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 +// XFAIL: libcpp-has-no-wide-characters // diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp @@ -11,6 +11,8 @@ // XFAIL: LIBCXX-WINDOWS-FIXME +// XFAIL: libcpp-has-no-wide-characters + // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.ru_RU.UTF-8 diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.ru_RU.UTF-8 diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.ru_RU.UTF-8 diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.ru_RU.UTF-8 diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp @@ -14,6 +14,8 @@ // get_date(iter_type s, iter_type end, ios_base& str, // ios_base::iostate& err, tm* t) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp @@ -14,6 +14,8 @@ // get_monthname(iter_type s, iter_type end, ios_base& str, // ios_base::iostate& err, tm* t) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp @@ -14,6 +14,8 @@ // get_time(iter_type s, iter_type end, ios_base& str, // ios_base::iostate& err, tm* t) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp @@ -14,6 +14,8 @@ // get_weekday(iter_type s, iter_type end, ios_base& str, // ios_base::iostate& err, tm* t) const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp @@ -30,11 +30,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == '.'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == L'.'); } +#endif } { std::locale l(LOCALE_en_US_UTF_8); @@ -43,11 +45,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == '.'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == L'.'); } +#endif } { std::locale l(LOCALE_fr_FR_UTF_8); @@ -56,11 +60,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == ','); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == L','); } +#endif } return 0; diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp @@ -35,11 +35,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == ""); } +#endif } { std::locale l(LOCALE_en_US_UTF_8); @@ -48,11 +50,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == "\3\3"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == "\3\3"); } +#endif } { std::locale l(LOCALE_fr_FR_UTF_8); @@ -66,11 +70,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == group); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == group); } +#endif } return 0; diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp @@ -36,11 +36,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == ','); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == L','); } +#endif } { std::locale l(LOCALE_en_US_UTF_8); @@ -49,32 +51,39 @@ const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == ','); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == L','); } +#endif } { + // The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep. std::locale l(LOCALE_fr_FR_UTF_8); -// The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep. + { #if defined(_CS_GNU_LIBC_VERSION) - const char sep = ' '; - const wchar_t wsep = glibc_version_less_than("2.27") ? L' ' : L'\u202f'; + const char sep = ' '; #else - const char sep = ','; - const wchar_t wsep = L','; + const char sep = ','; #endif - { typedef char C; const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == sep); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { +#if defined(_CS_GNU_LIBC_VERSION) + const wchar_t wsep = glibc_version_less_than("2.27") ? L' ' : L'\u202f'; +#else + const wchar_t wsep = L','; +#endif typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == wsep); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS } return 0; diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp @@ -49,6 +49,8 @@ assert(my_facet::count == 1); } assert(my_facet::count == 0); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale l(std::locale::classic(), new my_facet); assert(my_facet::count == 1); @@ -64,6 +66,7 @@ assert(my_facet::count == 1); } assert(my_facet::count == 0); +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp @@ -25,11 +25,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == '.'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.decimal_point() == L'.'); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp @@ -25,11 +25,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.falsename() == std::string("false")); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.falsename() == std::wstring(L"false")); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp @@ -25,11 +25,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == std::string()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.grouping() == std::string()); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp @@ -25,11 +25,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == ','); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.thousands_sep() == L','); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp @@ -25,11 +25,13 @@ const std::numpunct& np = std::use_facet >(l); assert(np.truename() == std::string("true")); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t C; const std::numpunct& np = std::use_facet >(l); assert(np.truename() == std::wstring(L"true")); } +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp --- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp @@ -37,6 +37,7 @@ static_assert((std::is_same::string_type, std::string>::value), ""); static_assert((std::is_base_of >::value), ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { assert(std::has_facet >(l)); const std::numpunct& f = std::use_facet >(l); @@ -48,6 +49,7 @@ static_assert((std::is_same::string_type, std::wstring>::value), ""); static_assert((std::is_base_of >::value), ""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp @@ -16,6 +16,8 @@ // // unspecified // }; +// XFAIL: libcpp-has-no-wide-characters + // Not a portable test #include diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp @@ -25,12 +25,14 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf16 C; C c; bool r = c.always_noconv(); assert(r == false); } +#endif { typedef std::codecvt_utf16 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp @@ -25,12 +25,14 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf16 C; C c; int r = c.encoding(); assert(r == 0); } +#endif { typedef std::codecvt_utf16 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp @@ -69,7 +69,9 @@ } int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS TestHelper::test(); +#endif TestHelper::test(); TestHelper::test(); return 0; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp @@ -350,7 +350,9 @@ int main(int, char**) { TestHelper::test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS TestHelper::test(); +#endif return 0; } diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp @@ -27,6 +27,7 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf16 C; C c; @@ -36,6 +37,7 @@ std::codecvt_base::result r = c.unshift(m, n, n+4, np); assert(r == std::codecvt_base::noconv); } +#endif { typedef std::codecvt_utf16 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp @@ -16,6 +16,8 @@ // // unspecified // }; +// XFAIL: libcpp-has-no-wide-characters + // Not a portable test #include diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp @@ -25,12 +25,14 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8 C; C c; bool r = c.always_noconv(); assert(r == false); } +#endif { typedef std::codecvt_utf8 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp @@ -25,12 +25,14 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8 C; C c; int r = c.encoding(); assert(r == 0); } +#endif { typedef std::codecvt_utf8 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp @@ -190,7 +190,9 @@ } int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS TestHelper::test(); +#endif TestHelper::test(); TestHelper::test(); return 0; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp @@ -69,7 +69,9 @@ } int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS TestHelper::test(); +#endif TestHelper::test(); TestHelper::test(); return 0; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp @@ -321,7 +321,9 @@ } int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS TestHelper::test(); +#endif TestHelper::test(); TestHelper::test(); diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp @@ -27,6 +27,7 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8 C; C c; @@ -36,6 +37,7 @@ std::codecvt_base::result r = c.unshift(m, n, n+4, np); assert(r == std::codecvt_base::noconv); } +#endif { typedef std::codecvt_utf8 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp @@ -25,12 +25,14 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8_utf16 C; C c; bool r = c.always_noconv(); assert(r == false); } +#endif { typedef std::codecvt_utf8_utf16 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp @@ -25,12 +25,14 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8_utf16 C; C c; int r = c.encoding(); assert(r == 0); } +#endif { typedef std::codecvt_utf8_utf16 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp @@ -237,7 +237,7 @@ } int main(int, char**) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(TEST_HAS_NO_WIDE_CHARACTERS) TestHelper::test(); #endif TestHelper::test(); diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp @@ -26,6 +26,7 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8_utf16 C; C c; @@ -95,6 +96,7 @@ r = c.length(m, n, n+1, 2); assert(r == 1); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8_utf16 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp @@ -25,6 +25,7 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8_utf16 C; C c; @@ -37,6 +38,7 @@ int r = c.max_length(); assert(r == 7); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8_utf16 C; C c; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp @@ -302,7 +302,7 @@ } int main(int, char**) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(TEST_HAS_NO_WIDE_CHARACTERS) TestHelper::test(); #endif TestHelper::test(); diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp @@ -27,6 +27,7 @@ int main(int, char**) { +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::codecvt_utf8_utf16 C; C c; @@ -36,6 +37,7 @@ std::codecvt_base::result r = c.unshift(m, n, n+4, np); assert(r == std::codecvt_base::noconv); } +#endif { typedef std::codecvt_utf8_utf16 C; C c; diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp @@ -18,6 +18,8 @@ // explicit wbuffer_convert(streambuf* bytebuf, Codecvt* pcvt = new Codecvt, // state_type state = state_type()); // C++20 +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp @@ -14,6 +14,8 @@ // This test is not entirely portable +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp @@ -16,6 +16,8 @@ // This test is not entirely portable +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp @@ -12,6 +12,8 @@ // streambuf *rdbuf(streambuf *bytebuf); +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp @@ -17,6 +17,8 @@ // This test is not entirely portable +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp @@ -12,6 +12,8 @@ // state_type state() const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp @@ -10,6 +10,8 @@ // wbuffer_convert +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp @@ -16,6 +16,8 @@ // This test is not entirely portable +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp @@ -12,6 +12,8 @@ // size_t converted() const; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp @@ -15,6 +15,8 @@ // wstring_convert() : wstring_convert(new Codecvt) {} // C++20 // explicit wstring_convert(Codecvt* pcvt); // C++20 +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp @@ -12,6 +12,8 @@ // wstring_convert(Codecvt* pcvt, state_type state); +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp @@ -17,6 +17,8 @@ // wstring_convert(wstring_convert const&) = delete; // wstring_convert& operator=(wstring_convert const&) = delete; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp @@ -13,6 +13,8 @@ // wstring_convert(const byte_string& byte_err, // const wide_string& wide_err = wide_string()); +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp @@ -15,6 +15,8 @@ // wide_string from_bytes(const byte_string& str); // wide_string from_bytes(const char* first, const char* last); +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp @@ -12,6 +12,8 @@ // state_type state() const; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp @@ -15,6 +15,8 @@ // byte_string to_bytes(const wide_string& wstr); // byte_string to_bytes(const Elem* first, const Elem* last); +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp @@ -19,6 +19,8 @@ // typedef typename Codecvt::state_type state_type; // typedef typename wide_string::traits_type::int_type int_type; +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp @@ -30,43 +30,42 @@ #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp @@ -33,44 +33,42 @@ #include "test_macros.h" +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp @@ -28,43 +28,42 @@ #include "test_macros.h" #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp @@ -27,43 +27,42 @@ #include "platform_support.h" // locale name macros #include "count_new.h" +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp @@ -30,43 +30,42 @@ #include "test_macros.h" #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp @@ -29,43 +29,42 @@ #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } struct my_facet diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp @@ -30,43 +30,42 @@ #include "test_macros.h" #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp @@ -30,44 +30,42 @@ #include "test_macros.h" #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp @@ -29,43 +29,42 @@ #include "test_macros.h" #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp @@ -26,43 +26,42 @@ #include "test_macros.h" +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } struct my_facet diff --git a/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp @@ -29,11 +29,13 @@ std::string s3("BaaaaaA"); assert(l(s3, s2)); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s2(L"aaaaaaA"); std::wstring s3(L"BaaaaaA"); assert(l(s3, s2)); } +#endif } return 0; diff --git a/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp @@ -23,43 +23,42 @@ #include "test_macros.h" +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp --- a/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp @@ -26,43 +26,42 @@ #include "test_macros.h" #include "platform_support.h" // locale name macros +template +void check_for(const std::locale& loc) +{ + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + + assert((std::has_facet >(loc))); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); + assert(std::has_facet >(loc)); + + assert(std::has_facet >(loc)); +} + void check(const std::locale& loc) { - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); + check_for(loc); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + check_for(loc); +#endif - assert(std::has_facet >(loc)); - assert(std::has_facet >(loc)); - assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); - - assert((std::has_facet >(loc))); - assert((std::has_facet >(loc))); } int main(int, char**) diff --git a/libcxx/test/std/namespace/addressable_functions.sh.cpp b/libcxx/test/std/namespace/addressable_functions.sh.cpp --- a/libcxx/test/std/namespace/addressable_functions.sh.cpp +++ b/libcxx/test/std/namespace/addressable_functions.sh.cpp @@ -28,25 +28,32 @@ #include #include +#include "test_macros.h" typedef std::ios_base& (FormatFlagFunction)(std::ios_base&); typedef std::basic_ostream& (OstreamManipFunction)(std::basic_ostream&); -typedef std::basic_ostream& (WOstreamManipFunction)(std::basic_ostream&); typedef std::basic_istream& (IstreamManipFunction)(std::basic_istream&); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +typedef std::basic_ostream& (WOstreamManipFunction)(std::basic_ostream&); typedef std::basic_istream& (WIstreamManipFunction)(std::basic_istream&); +#endif extern FormatFlagFunction* get_formatflag_tu1(std::string); extern FormatFlagFunction* get_formatflag_tu2(std::string); extern OstreamManipFunction* get_ostreammanip_tu1(std::string); extern OstreamManipFunction* get_ostreammanip_tu2(std::string); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS extern WOstreamManipFunction* get_wostreammanip_tu1(std::string); extern WOstreamManipFunction* get_wostreammanip_tu2(std::string); +#endif extern IstreamManipFunction* get_istreammanip_tu1(std::string); extern IstreamManipFunction* get_istreammanip_tu2(std::string); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS extern WIstreamManipFunction* get_wistreammanip_tu1(std::string); extern WIstreamManipFunction* get_wistreammanip_tu2(std::string); +#endif #ifdef TU1 FormatFlagFunction* get_formatflag_tu1(std::string func) @@ -107,11 +114,12 @@ } // [ostream.manip] (wchar_t) -#ifdef TU1 +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# ifdef TU1 WOstreamManipFunction* get_wostreammanip_tu1(std::string func) -#else +# else WOstreamManipFunction* get_wostreammanip_tu2(std::string func) -#endif +# endif { std::map all_funcs; typedef std::char_traits Traits; @@ -120,6 +128,7 @@ all_funcs.insert(std::make_pair("flush", &std::flush)); return all_funcs.at(func); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS // [istream.manip] (char) #ifdef TU1 @@ -135,18 +144,19 @@ } // [istream.manip] (wchar_t) -#ifdef TU1 +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# ifdef TU1 WIstreamManipFunction* get_wistreammanip_tu1(std::string func) -#else +# else WIstreamManipFunction* get_wistreammanip_tu2(std::string func) -#endif +# endif { std::map all_funcs; typedef std::char_traits Traits; all_funcs.insert(std::make_pair("ws", &std::ws)); return all_funcs.at(func); } - +#endif // TEST_HAS_NO_WIDE_CHARACTERS #ifdef TU2 int main(int, char**) { @@ -179,13 +189,17 @@ assert(get_ostreammanip_tu1("ends") == get_ostreammanip_tu2("ends")); assert(get_ostreammanip_tu1("flush") == get_ostreammanip_tu2("flush")); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert(get_wostreammanip_tu1("endl") == get_wostreammanip_tu2("endl")); assert(get_wostreammanip_tu1("ends") == get_wostreammanip_tu2("ends")); assert(get_wostreammanip_tu1("flush") == get_wostreammanip_tu2("flush")); +#endif assert(get_istreammanip_tu1("ws") == get_istreammanip_tu2("ws")); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert(get_wistreammanip_tu1("ws") == get_wistreammanip_tu2("ws")); +#endif return 0; } diff --git a/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp b/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp --- a/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp +++ b/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp @@ -27,7 +27,7 @@ static_assert(std::same_as>); static_assert(std::same_as>); + std::ranges::subrange>); struct ForwardRange { forward_iterator begin() const; diff --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp @@ -71,6 +71,8 @@ std::regex_constants::awk))); assert(m.size() == 0); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -112,5 +114,6 @@ std::regex_constants::awk))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp @@ -663,6 +663,8 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; const wchar_t s[] = L"a"; @@ -1303,5 +1305,6 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp @@ -73,6 +73,8 @@ std::regex_constants::basic))); assert(m.size() == 0); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -114,5 +116,7 @@ std::regex_constants::basic))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp @@ -650,6 +650,7 @@ assert(m.str(0) == s); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; assert(!std::regex_match(L"a", m, std::wregex())); @@ -1276,6 +1277,8 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + { // LWG 2273 std::regex re("Foo|FooBar"); std::cmatch m; diff --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp @@ -32,6 +32,47 @@ int main(int, char**) { + std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); + { + std::cmatch m; + const char s[] = "m"; + assert(std::regex_match(s, m, std::regex("[a[=M=]z]"))); + assert(m.size() == 1); + assert(!m.prefix().matched); + assert(m.prefix().first == s); + assert(m.prefix().second == m[0].first); + assert(!m.suffix().matched); + assert(m.suffix().first == m[0].second); + assert(m.suffix().second == m[0].second); + assert(m.length(0) >= 0 && static_cast(m.length(0)) == std::char_traits::length(s)); + assert(m.position(0) == 0); + assert(m.str(0) == s); + } + { + std::cmatch m; + const char s[] = "Ch"; + assert(std::regex_match(s, m, std::regex("[a[.ch.]z]", + std::regex_constants::icase))); + assert(m.size() == 1); + assert(!m.prefix().matched); + assert(m.prefix().first == s); + assert(m.prefix().second == m[0].first); + assert(!m.suffix().matched); + assert(m.suffix().first == m[0].second); + assert(m.suffix().second == m[0].second); + assert(m.length(0) >= 0 && static_cast(m.length(0)) == std::char_traits::length(s)); + assert(m.position(0) == 0); + assert(m.str(0) == s); + } + std::locale::global(std::locale("C")); + { + std::cmatch m; + const char s[] = "m"; + assert(!std::regex_match(s, m, std::regex("[a[=M=]z]"))); + assert(m.size() == 0); + } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -71,5 +112,7 @@ assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]"))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp @@ -670,6 +670,7 @@ assert(m.str(0) == s); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; const wchar_t s[] = L"a"; @@ -1304,6 +1305,7 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp @@ -73,6 +73,8 @@ std::regex_constants::extended))); assert(m.size() == 0); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -114,5 +116,7 @@ std::regex_constants::extended))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp @@ -665,6 +665,7 @@ assert(m.str(0) == s); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; const wchar_t s[] = L"a"; @@ -1307,6 +1308,7 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp @@ -73,6 +73,8 @@ std::regex_constants::awk))); assert(m.size() == 0); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -114,5 +116,7 @@ std::regex_constants::awk))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp @@ -753,6 +753,8 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; const wchar_t s[] = L"a"; @@ -1483,6 +1485,7 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp @@ -73,6 +73,8 @@ std::regex_constants::basic))); assert(m.size() == 0); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -114,5 +116,7 @@ std::regex_constants::basic))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp @@ -740,6 +740,7 @@ assert(m.str(0) == s); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; assert(!std::regex_search(L"a", m, std::wregex())); @@ -1456,6 +1457,8 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + { // LWG 2273 std::regex re("Foo|FooBar"); std::cmatch m; diff --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp @@ -71,6 +71,8 @@ assert(!std::regex_search(s, m, std::regex("[a[=M=]z]"))); assert(m.size() == 0); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -110,5 +112,7 @@ assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]"))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp @@ -763,6 +763,7 @@ assert(m.str(0) == s); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; const wchar_t s[] = L"a"; @@ -1502,6 +1503,7 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp @@ -73,6 +73,8 @@ std::regex_constants::extended))); assert(m.size() == 0); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); { std::wcmatch m; @@ -114,5 +116,7 @@ std::regex_constants::extended))); assert(m.size() == 0); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS + return 0; } diff --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp @@ -756,6 +756,7 @@ assert(m.str(0) == s); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wcmatch m; const wchar_t s[] = L"a"; @@ -1488,6 +1489,7 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp --- a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp +++ b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp @@ -28,7 +28,9 @@ int main(int, char**) { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp --- a/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp +++ b/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp @@ -41,7 +41,9 @@ int main(int, char**) { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp --- a/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp +++ b/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp @@ -42,6 +42,7 @@ assert(re.mark_count() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s1(L"\\(a\\)"); std::basic_regex re(s1.begin(), s1.end(), std::regex_constants::basic); @@ -50,6 +51,7 @@ assert(re.flags() == std::regex_constants::basic); assert(re.mark_count() == 1); } +#endif // Test the implicit deduction guides { @@ -60,6 +62,7 @@ assert(re.mark_count() == 2); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { // basic_regex(string, flag_type); std::basic_regex re(L"(a([bc]))"s, std::regex_constants::awk); @@ -67,6 +70,7 @@ assert(re.flags() == std::regex_constants::awk); assert(re.mark_count() == 2); } +#endif { // basic_regex(const charT*); @@ -76,6 +80,7 @@ assert(re.mark_count() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { // basic_regex(const charT*, flag_type); std::basic_regex re(L"ABCDE", std::regex_constants::grep); @@ -83,6 +88,7 @@ assert(re.flags() == std::regex_constants::grep); assert(re.mark_count() == 0); } +#endif { // basic_regex(const charT*, size_t); @@ -92,6 +98,7 @@ assert(re.mark_count() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { // basic_regex(const charT*, size_t, flag_type); std::basic_regex re(L"ABCDEDEF", 8, std::regex_constants::awk); @@ -99,6 +106,7 @@ assert(re.flags() == std::regex_constants::awk); assert(re.mark_count() == 0); } +#endif { // basic_regex(const basic_regex &); @@ -123,6 +131,7 @@ assert(re.mark_count() == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { // basic_regex(initializer_list, flag_type); std::basic_regex re({L'A', L'B', L'F', L'E', L'D'}, std::regex_constants::grep); @@ -130,6 +139,7 @@ assert(re.flags() == std::regex_constants::grep); assert(re.mark_count() == 0); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp --- a/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp +++ b/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp @@ -28,7 +28,9 @@ int main(int, char**) { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp b/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp @@ -31,7 +31,9 @@ int main(int, char**) { test(test_allocator >(3)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(test_allocator >(3)); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp @@ -31,7 +31,9 @@ int main(int, char**) { test(test_allocator >(3)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(test_allocator >(3)); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp @@ -33,10 +33,14 @@ int main(int, char**) { test (std::allocator >()); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::allocator >()); +#endif test (test_allocator >(3)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(test_allocator >(3)); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp @@ -37,15 +37,21 @@ int main(int, char**) { test (std::allocator >()); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::allocator >()); +#endif -// test_allocator has POCCA -> false + // test_allocator has POCCA -> false test (test_allocator >(3)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(test_allocator >(3)); +#endif -// other_allocator has POCCA -> true + // other_allocator has POCCA -> true test (other_allocator >(3)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(other_allocator >(3)); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp @@ -46,7 +46,9 @@ int main(int, char**) { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp @@ -38,12 +38,16 @@ int main(int, char**) { test (std::allocator >()); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::allocator >()); +#endif test (test_allocator >(3)); assert(test_alloc_base::moved == 1); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(test_allocator >(3)); assert(test_alloc_base::moved == 2); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp @@ -38,15 +38,21 @@ int main(int, char**) { test (std::allocator >()); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::allocator >()); +#endif -// test_allocator has POCMA -> false + // test_allocator has POCMA -> false test (test_allocator >(3)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(test_allocator >(3)); +#endif -// other_allocator has POCMA -> true + // other_allocator has POCMA -> true test (other_allocator >(3)); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(other_allocator >(3)); +#endif return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp @@ -114,6 +114,7 @@ assert(std::string(out) == "match: cdefghi, m[1]: , m[2]: "); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::match_results m; const wchar_t s[] = L"abcdefghijk"; @@ -152,6 +153,7 @@ assert(r == out + 34); assert(std::wstring(out) == L"match: cdefghi, m[1]: efg, m[2]: e"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp @@ -25,7 +25,6 @@ int main(int, char**) { typedef std::basic_string, test_allocator > nstr; - typedef std::basic_string, test_allocator > wstr; { std::match_results m; const char s[] = "abcdefghijk"; @@ -62,6 +61,8 @@ assert(std::string(out) == "match: cdefghi, m[1]: efg, m[2]: e"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + typedef std::basic_string, test_allocator > wstr; { std::match_results m; const wchar_t s[] = L"abcdefghijk"; @@ -97,6 +98,7 @@ assert(r == out + 34); assert(std::wstring(out) == L"match: cdefghi, m[1]: efg, m[2]: e"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp @@ -24,7 +24,6 @@ int main(int, char**) { typedef std::basic_string, test_allocator > nstr; - typedef std::basic_string, test_allocator > wstr; { std::match_results m; const char s[] = "abcdefghijk"; @@ -53,6 +52,8 @@ assert(out == "match: cdefghi, m[1]: efg, m[2]: e"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + typedef std::basic_string, test_allocator > wstr; { std::match_results m; const wchar_t s[] = L"abcdefghijk"; @@ -80,6 +81,7 @@ wstr out = m.format(fmt, std::regex_constants::format_sed); assert(out == L"match: cdefghi, m[1]: efg, m[2]: e"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp --- a/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp +++ b/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp @@ -48,6 +48,7 @@ assert(out == "match: cdefghi, m[1]: efg, m[2]: e"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::match_results m; const wchar_t s[] = L"abcdefghijk"; @@ -75,6 +76,7 @@ std::wstring out = m.format(fmt, std::regex_constants::format_sed); assert(out == L"match: cdefghi, m[1]: efg, m[2]: e"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp @@ -31,6 +31,7 @@ assert(sm.compare(string()) > 0); assert(sm.compare(string("123")) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t CharT; typedef std::sub_match SM; @@ -44,6 +45,7 @@ assert(sm.compare(string()) > 0); assert(sm.compare(string(L"123")) == 0); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp @@ -34,6 +34,7 @@ sm2.matched = true; assert(sm.compare(sm2) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t CharT; typedef std::sub_match SM; @@ -50,6 +51,7 @@ sm2.matched = true; assert(sm.compare(sm2) == 0); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp @@ -30,6 +30,7 @@ assert(sm.compare("") > 0); assert(sm.compare("123") == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t CharT; typedef std::sub_match SM; @@ -42,6 +43,7 @@ assert(sm.compare(L"") > 0); assert(sm.compare(L"123") == 0); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp @@ -24,12 +24,14 @@ SM sm; assert(sm.matched == false); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t CharT; typedef std::sub_match SM; SM sm; assert(sm.matched == false); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp @@ -29,6 +29,7 @@ sm.matched = true; assert(sm.length() == 3); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t CharT; typedef std::sub_match SM; @@ -40,6 +41,7 @@ sm.matched = true; assert(sm.length() == 3); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp @@ -31,6 +31,7 @@ str = sm; assert(str == std::string("123")); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t CharT; typedef std::sub_match SM; @@ -44,6 +45,7 @@ str = sm; assert(str == std::wstring(L"123")); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp @@ -31,6 +31,7 @@ str = sm.str(); assert(str == std::string("123")); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef wchar_t CharT; typedef std::sub_match SM; @@ -44,6 +45,7 @@ str = sm.str(); assert(str == std::wstring(L"123")); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp @@ -280,10 +280,12 @@ { test(std::string("123"), std::string("123")); test(std::string("1234"), std::string("123")); + test(std::string("123\000" "56", 6), std::string("123\000" "56", 6), false); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::wstring(L"123"), std::wstring(L"123")); test(std::wstring(L"1234"), std::wstring(L"123")); - test(std::string("123\000" "56", 6), std::string("123\000" "56", 6), false); test(std::wstring(L"123\000" L"56", 6), std::wstring(L"123\000" L"56", 6), false); +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp --- a/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp +++ b/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp @@ -38,7 +38,9 @@ int main(int, char**) { test(std::string("123")); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::wstring(L"123")); +#endif return 0; } diff --git a/libcxx/test/std/re/re.submatch/types.pass.cpp b/libcxx/test/std/re/re.submatch/types.pass.cpp --- a/libcxx/test/std/re/re.submatch/types.pass.cpp +++ b/libcxx/test/std/re/re.submatch/types.pass.cpp @@ -37,11 +37,16 @@ static_assert((std::is_same::value), ""); static_assert((std::is_convertible*>::value), ""); + static_assert((std::is_same >::value), ""); + static_assert((std::is_same >::value), ""); + SM sm; sm.first = nullptr; sm.second = nullptr; sm.matched = false; } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::sub_match SM; static_assert((std::is_same::value), ""); @@ -50,17 +55,15 @@ static_assert((std::is_same::value), ""); static_assert((std::is_convertible*>::value), ""); + static_assert((std::is_same >::value), ""); + static_assert((std::is_same >::value), ""); + SM sm; sm.first = nullptr; sm.second = nullptr; sm.matched = false; } - { - static_assert((std::is_same >::value), ""); - static_assert((std::is_same >::value), ""); - static_assert((std::is_same >::value), ""); - static_assert((std::is_same >::value), ""); - } +#endif return 0; } diff --git a/libcxx/test/std/re/re.syn/wcmatch.pass.cpp b/libcxx/test/std/re/re.syn/wcmatch.pass.cpp --- a/libcxx/test/std/re/re.syn/wcmatch.pass.cpp +++ b/libcxx/test/std/re/re.syn/wcmatch.pass.cpp @@ -10,6 +10,8 @@ // typedef match_results wcmatch; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp --- a/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp +++ b/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp @@ -10,6 +10,8 @@ // typedef regex_iterator wcregex_iterator; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp --- a/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp +++ b/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp @@ -10,6 +10,8 @@ // typedef regex_token_iterator wcregex_token_iterator; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp b/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp --- a/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp +++ b/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp @@ -10,6 +10,8 @@ // typedef sub_match wcsub_match; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wregex.pass.cpp b/libcxx/test/std/re/re.syn/wregex.pass.cpp --- a/libcxx/test/std/re/re.syn/wregex.pass.cpp +++ b/libcxx/test/std/re/re.syn/wregex.pass.cpp @@ -10,6 +10,8 @@ // typedef basic_regex wregex; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wsmatch.pass.cpp b/libcxx/test/std/re/re.syn/wsmatch.pass.cpp --- a/libcxx/test/std/re/re.syn/wsmatch.pass.cpp +++ b/libcxx/test/std/re/re.syn/wsmatch.pass.cpp @@ -10,6 +10,8 @@ // typedef match_results wsmatch; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp --- a/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp +++ b/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp @@ -10,6 +10,8 @@ // typedef regex_iterator wsregex_iterator; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp --- a/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp +++ b/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp @@ -10,6 +10,8 @@ // typedef regex_token_iterator wsregex_token_iterator; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.syn/wssub_match.pass.cpp b/libcxx/test/std/re/re.syn/wssub_match.pass.cpp --- a/libcxx/test/std/re/re.syn/wssub_match.pass.cpp +++ b/libcxx/test/std/re/re.syn/wssub_match.pass.cpp @@ -10,6 +10,8 @@ // typedef sub_match wssub_match; +// XFAIL: libcpp-has-no-wide-characters + #include #include #include "test_macros.h" diff --git a/libcxx/test/std/re/re.traits/default.pass.cpp b/libcxx/test/std/re/re.traits/default.pass.cpp --- a/libcxx/test/std/re/re.traits/default.pass.cpp +++ b/libcxx/test/std/re/re.traits/default.pass.cpp @@ -23,18 +23,27 @@ int main(int, char**) { { - std::regex_traits t1; - assert(t1.getloc().name() == "C"); - std::regex_traits t2; - assert(t2.getloc().name() == "C"); + std::regex_traits t; + assert(t.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + std::regex_traits t; + assert(t.getloc().name() == "C"); + } +#endif + { + std::locale::global(std::locale(LOCALE_en_US_UTF_8)); + std::regex_traits t; + assert(t.getloc().name() == LOCALE_en_US_UTF_8); + } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale::global(std::locale(LOCALE_en_US_UTF_8)); - std::regex_traits t1; - assert(t1.getloc().name() == LOCALE_en_US_UTF_8); - std::regex_traits t2; - assert(t2.getloc().name() == LOCALE_en_US_UTF_8); + std::regex_traits t; + assert(t.getloc().name() == LOCALE_en_US_UTF_8); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/getloc.pass.cpp b/libcxx/test/std/re/re.traits/getloc.pass.cpp --- a/libcxx/test/std/re/re.traits/getloc.pass.cpp +++ b/libcxx/test/std/re/re.traits/getloc.pass.cpp @@ -23,18 +23,27 @@ int main(int, char**) { { - std::regex_traits t1; - assert(t1.getloc().name() == "C"); - std::regex_traits t2; - assert(t2.getloc().name() == "C"); + std::regex_traits t; + assert(t.getloc().name() == "C"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + std::regex_traits t; + assert(t.getloc().name() == "C"); + } +#endif + { + std::locale::global(std::locale(LOCALE_en_US_UTF_8)); + std::regex_traits t; + assert(t.getloc().name() == LOCALE_en_US_UTF_8); + } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::locale::global(std::locale(LOCALE_en_US_UTF_8)); - std::regex_traits t1; - assert(t1.getloc().name() == LOCALE_en_US_UTF_8); - std::regex_traits t2; - assert(t2.getloc().name() == LOCALE_en_US_UTF_8); + std::regex_traits t; + assert(t.getloc().name() == LOCALE_en_US_UTF_8); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/isctype.pass.cpp b/libcxx/test/std/re/re.traits/isctype.pass.cpp --- a/libcxx/test/std/re/re.traits/isctype.pass.cpp +++ b/libcxx/test/std/re/re.traits/isctype.pass.cpp @@ -150,6 +150,8 @@ assert(!t.isctype('-', t.lookup_classname(s.begin(), s.end()))); assert(!t.isctype('@', t.lookup_classname(s.begin(), s.end()))); } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::regex_traits t; @@ -279,6 +281,7 @@ assert(!t.isctype(L'-', t.lookup_classname(s.begin(), s.end()))); assert(!t.isctype(L'@', t.lookup_classname(s.begin(), s.end()))); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.traits/length.pass.cpp b/libcxx/test/std/re/re.traits/length.pass.cpp --- a/libcxx/test/std/re/re.traits/length.pass.cpp +++ b/libcxx/test/std/re/re.traits/length.pass.cpp @@ -23,10 +23,12 @@ assert(std::regex_traits::length("12") == 2); assert(std::regex_traits::length("123") == 3); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert(std::regex_traits::length(L"") == 0); assert(std::regex_traits::length(L"1") == 1); assert(std::regex_traits::length(L"12") == 2); assert(std::regex_traits::length(L"123") == 3); +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp b/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp --- a/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp +++ b/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp @@ -158,6 +158,7 @@ test("", std::ctype_base::mask()); test("digits", std::ctype_base::mask()); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(L"d", std::ctype_base::digit); test(L"D", std::ctype_base::digit); test(L"d", std::ctype_base::digit, true); @@ -245,6 +246,7 @@ test(L"dig", std::ctype_base::mask()); test(L"", std::ctype_base::mask()); test(L"digits", std::ctype_base::mask()); +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp b/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp --- a/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp +++ b/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp @@ -117,6 +117,7 @@ test("ch", std::string("ch")); std::locale::global(std::locale("C")); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(L"NUL", std::wstring(L"\x00", 1)); test(L"alert", std::wstring(L"\x07")); test(L"backspace", std::wstring(L"\x08")); @@ -192,6 +193,7 @@ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); test(L"ch", std::wstring(L"ch")); std::locale::global(std::locale("C")); +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/re/re.traits/transform.pass.cpp b/libcxx/test/std/re/re.traits/transform.pass.cpp --- a/libcxx/test/std/re/re.traits/transform.pass.cpp +++ b/libcxx/test/std/re/re.traits/transform.pass.cpp @@ -35,6 +35,7 @@ t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2)); assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1))); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::regex_traits t; const wchar_t a[] = L"a"; @@ -44,6 +45,7 @@ t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2)); assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1))); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/transform_primary.pass.cpp b/libcxx/test/std/re/re.traits/transform_primary.pass.cpp --- a/libcxx/test/std/re/re.traits/transform_primary.pass.cpp +++ b/libcxx/test/std/re/re.traits/transform_primary.pass.cpp @@ -39,6 +39,7 @@ assert(t.transform_primary(F(A), F(A+1)) == t.transform_primary(F(Aacute), F(Aacute+1))); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::regex_traits t; const wchar_t A[] = L"A"; @@ -50,6 +51,7 @@ assert(t.transform_primary(F(A), F(A+1)) == t.transform_primary(F(Aacute), F(Aacute+1))); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/translate.pass.cpp b/libcxx/test/std/re/re.traits/translate.pass.cpp --- a/libcxx/test/std/re/re.traits/translate.pass.cpp +++ b/libcxx/test/std/re/re.traits/translate.pass.cpp @@ -24,12 +24,14 @@ assert(t.translate('B') == 'B'); assert(t.translate('c') == 'c'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::regex_traits t; assert(t.translate(L'a') == L'a'); assert(t.translate(L'B') == L'B'); assert(t.translate(L'c') == L'c'); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp b/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp --- a/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp +++ b/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp @@ -40,6 +40,7 @@ assert(t.translate_nocase('a') == 'a'); assert(t.translate_nocase('1') == '1'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::regex_traits t; assert(t.translate_nocase(L' ') == L' '); @@ -60,6 +61,7 @@ assert(t.translate_nocase(L'\xDA') == L'\xFA'); assert(t.translate_nocase(L'\xFA') == L'\xFA'); } +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/types.pass.cpp b/libcxx/test/std/re/re.traits/types.pass.cpp --- a/libcxx/test/std/re/re.traits/types.pass.cpp +++ b/libcxx/test/std/re/re.traits/types.pass.cpp @@ -25,9 +25,11 @@ static_assert((std::is_same::char_type, char>::value), ""); static_assert((std::is_same::string_type, std::string>::value), ""); static_assert((std::is_same::locale_type, std::locale>::value), ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert((std::is_same::char_type, wchar_t>::value), ""); static_assert((std::is_same::string_type, std::wstring>::value), ""); static_assert((std::is_same::locale_type, std::locale>::value), ""); +#endif return 0; } diff --git a/libcxx/test/std/re/re.traits/value.pass.cpp b/libcxx/test/std/re/re.traits/value.pass.cpp --- a/libcxx/test/std/re/re.traits/value.pass.cpp +++ b/libcxx/test/std/re/re.traits/value.pass.cpp @@ -70,6 +70,7 @@ assert(t.value(char(c), 16) == -1); } } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::regex_traits t; @@ -122,6 +123,7 @@ assert(t.value(c, 16) == -1); } } +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp b/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp --- a/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp +++ b/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp @@ -23,7 +23,9 @@ test_library_hash_specializations_available(); { test_hash_enabled_for_type(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_hash_enabled_for_type(); +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test_hash_enabled_for_type(); #endif diff --git a/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp b/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp --- a/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp +++ b/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp @@ -50,7 +50,9 @@ test(); test(); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp b/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp --- a/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp +++ b/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp @@ -25,31 +25,41 @@ ASSERT_SAME_TYPE(decltype( "Hi"s), std::string); ASSERT_SAME_TYPE(decltype(u8"Hi"s), u8string); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ASSERT_SAME_TYPE(decltype( L"Hi"s), std::wstring); +#endif ASSERT_SAME_TYPE(decltype( u"Hi"s), std::u16string); ASSERT_SAME_TYPE(decltype( U"Hi"s), std::u32string); std::string foo; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::wstring Lfoo; +#endif u8string u8foo; std::u16string ufoo; std::u32string Ufoo; foo = ""s; assert( foo.size() == 0); u8foo = u8""s; assert(u8foo.size() == 0); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS Lfoo = L""s; assert( Lfoo.size() == 0); +#endif ufoo = u""s; assert( ufoo.size() == 0); Ufoo = U""s; assert( Ufoo.size() == 0); foo = " "s; assert( foo.size() == 1); u8foo = u8" "s; assert(u8foo.size() == 1); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS Lfoo = L" "s; assert( Lfoo.size() == 1); +#endif ufoo = u" "s; assert( ufoo.size() == 1); Ufoo = U" "s; assert( Ufoo.size() == 1); foo = "ABC"s; assert( foo == "ABC"); assert( foo == std::string ( "ABC")); u8foo = u8"ABC"s; assert(u8foo == u8"ABC"); assert(u8foo == u8string (u8"ABC")); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS Lfoo = L"ABC"s; assert( Lfoo == L"ABC"); assert( Lfoo == std::wstring ( L"ABC")); +#endif ufoo = u"ABC"s; assert( ufoo == u"ABC"); assert( ufoo == std::u16string( u"ABC")); Ufoo = U"ABC"s; assert( Ufoo == U"ABC"); assert( Ufoo == std::u32string( U"ABC")); } diff --git a/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp @@ -30,7 +30,9 @@ // Test that it's possible to take the address of basic_string's destructors // by creating globals which will register their destructors with cxa_atexit. std::string s; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::wstring ws; +#endif int main(int, char**) { diff --git a/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp @@ -62,18 +62,22 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "aaaaaa"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string w(2ull, L'b'); ASSERT_SAME_TYPE(decltype(w), std::wstring); assert(w == L"bb"); +#endif } { // Testing (3) w/ allocator std::basic_string s(6ull, 'a', test_allocator{}); ASSERT_SAME_TYPE(decltype(s), BStr>); assert(s == "aaaaaa"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string w(2ull, L'b', test_allocator{}); ASSERT_SAME_TYPE(decltype(w), BStr>); assert(w == L"bb"); +#endif } { // Testing (4) w/o allocator const std::string sin("abc"); @@ -81,6 +85,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "bc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -88,6 +93,7 @@ std::basic_string w(win, (TestSizeT)3); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"def"); +#endif } { // Testing (4) w/ allocator const std::string sin("abc"); @@ -95,6 +101,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "bc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -102,6 +109,7 @@ std::basic_string w(win, (TestSizeT)3, test_allocator{}); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"def"); +#endif } { // Testing (5) w/o allocator const std::string sin("abc"); @@ -109,6 +117,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "bc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -116,6 +125,7 @@ std::basic_string w(win, (TestSizeT)2, (TestSizeT)3); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"cde"); +#endif } { // Testing (5) w/ allocator const std::string sin("abc"); @@ -123,6 +133,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "bc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -130,48 +141,57 @@ std::basic_string w(win, (TestSizeT)2, (TestSizeT)3, test_allocator{}); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"cde"); +#endif } { // Testing (6) w/o allocator std::basic_string s("abc", (size_t)2); ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "ab"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string w(L"abcdef", (size_t)3); ASSERT_SAME_TYPE(decltype(w), std::wstring); assert(w == L"abc"); +#endif } { // Testing (6) w/ allocator std::basic_string s("abc", (size_t)2, std::allocator{}); ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "ab"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; std::basic_string w(L"abcdef", (TestSizeT)3, test_allocator{}); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"abc"); +#endif } { // Testing (7) w/o allocator std::basic_string s("abc"); ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string w(L"abcdef"); ASSERT_SAME_TYPE(decltype(w), std::wstring); assert(w == L"abcdef"); +#endif } { // Testing (7) w/ allocator std::basic_string s("abc", std::allocator{}); ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; std::basic_string w(L"abcdef", test_allocator{}); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"abcdef"); +#endif } { // (8) w/o allocator using It = cpp17_input_iterator; @@ -181,12 +201,24 @@ assert(s == "abc"); } { // (8) w/ allocator - using ExpectW = std::basic_string, test_allocator>; - using It = cpp17_input_iterator; - const wchar_t* input = L"abcdef"; - std::basic_string s(It(input), It(input + 3), test_allocator{}); - ASSERT_SAME_TYPE(decltype(s), ExpectW); - assert(s == L"abc"); + { + using Expect = std::basic_string, test_allocator>; + using It = cpp17_input_iterator; + const char* input = "abcdef"; + std::basic_string s(It(input), It(input + 3), test_allocator{}); + ASSERT_SAME_TYPE(decltype(s), Expect); + assert(s == "abc"); + } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + using ExpectW = std::basic_string, test_allocator>; + using It = cpp17_input_iterator; + const wchar_t* input = L"abcdef"; + std::basic_string s(It(input), It(input + 3), test_allocator{}); + ASSERT_SAME_TYPE(decltype(s), ExpectW); + assert(s == L"abc"); + } +#endif } { // Testing (9) const std::string sin("abc"); @@ -194,6 +226,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -201,6 +234,7 @@ std::basic_string w(win); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"abcdef"); +#endif } { // Testing (10) const std::string sin("abc"); @@ -208,6 +242,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -215,6 +250,7 @@ std::basic_string w(win, test_allocator{}); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"abcdef"); +#endif } { // Testing (11) std::string sin("abc"); @@ -222,6 +258,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -229,6 +266,7 @@ std::basic_string w(std::move(win)); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"abcdef"); +#endif } { // Testing (12) std::string sin("abc"); @@ -236,6 +274,7 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WStr = std::basic_string, test_allocator>; @@ -243,24 +282,29 @@ std::basic_string w(std::move(win), test_allocator{}); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"abcdef"); +#endif } { // Testing (13) w/o allocator std::basic_string s({'a', 'b', 'c'}); ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string w({L'a', L'b', L'c'}); ASSERT_SAME_TYPE(decltype(w), std::wstring); assert(w == L"abc"); +#endif } { // Testing (13) w/ allocator std::basic_string s({'a', 'b', 'c'}, test_allocator{}); ASSERT_SAME_TYPE(decltype(s), BStr>); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string w({L'a', L'b', L'c'}, test_allocator{}); ASSERT_SAME_TYPE(decltype(w), BStr>); assert(w == L"abc"); +#endif } { // Testing (14) w/o allocator std::string_view sv("abc"); @@ -268,11 +312,13 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using Expect = std::basic_string>; std::basic_string_view> BSV(L"abcdef"); std::basic_string w(BSV); ASSERT_SAME_TYPE(decltype(w), Expect); assert(w == L"abcdef"); +#endif } { // Testing (14) w/ allocator using ExpectS = std::basic_string, test_allocator>; @@ -281,12 +327,14 @@ ASSERT_SAME_TYPE(decltype(s), ExpectS); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using ExpectW = std::basic_string, test_allocator>; std::basic_string_view> BSV(L"abcdef"); std::basic_string w(BSV, test_allocator{}); ASSERT_SAME_TYPE(decltype(w), ExpectW); assert(w == L"abcdef"); +#endif } { // Testing (15) w/o allocator std::string s0("abc"); @@ -294,10 +342,12 @@ ASSERT_SAME_TYPE(decltype(s), std::string); assert(s == "b"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::wstring w0(L"abcdef"); std::basic_string w(w0, 2, 2); ASSERT_SAME_TYPE(decltype(w), std::wstring); assert(w == L"cd"); +#endif } { // Testing (15) w/ allocator using ExpectS = std::basic_string, test_allocator>; @@ -306,11 +356,13 @@ ASSERT_SAME_TYPE(decltype(s), ExpectS); assert(s == "b"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using ExpectW = std::basic_string, test_allocator>; ExpectW w0(L"abcdef"); std::basic_string w(w0, 2, 2, test_allocator{6}); ASSERT_SAME_TYPE(decltype(w), ExpectW); assert(w == L"cd"); +#endif } return 0; diff --git a/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp @@ -25,22 +25,26 @@ std::string s = {'a', 'b', 'c'}; assert(s == "abc"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s; s = {L'a', L'b', L'c'}; assert(s == L"abc"); } +#endif { typedef std::basic_string, min_allocator> S; S s = {'a', 'b', 'c'}; assert(s == "abc"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::basic_string, min_allocator> S; S s; s = {L'a', L'b', L'c'}; assert(s == L"abc"); } +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp @@ -59,6 +59,7 @@ assert(s1.size() == sv.size()); assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring_view sv = L"12345678901234"; std::basic_string s1{sv, test_allocator{}}; @@ -69,6 +70,7 @@ assert(s1.size() == sv.size()); assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); } +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L { std::u8string_view sv = u8"12345678901234"; diff --git a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp @@ -63,6 +63,7 @@ assert(s1.size() == 4); assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring_view sv = L"12345678901234"; std::basic_string s1{sv, 0, 4, test_allocator{}}; @@ -73,6 +74,7 @@ assert(s1.size() == 4); assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); } +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L { std::u8string_view sv = u8"12345678901234"; diff --git a/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp @@ -54,7 +54,9 @@ int main(int, char**) { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test(); diff --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp @@ -35,6 +35,7 @@ assert(in.eof()); assert(s == " ghij"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream in(L" abc\n def\n ghij"); std::wstring s(L"initial text"); @@ -48,6 +49,7 @@ assert(in.eof()); assert(s == L" ghij"); } +#endif #if TEST_STD_VER >= 11 { typedef std::basic_string, min_allocator> S; @@ -63,6 +65,7 @@ assert(in.eof()); assert(s == " ghij"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::basic_string, min_allocator> S; std::wistringstream in(L" abc\n def\n ghij"); @@ -77,7 +80,8 @@ assert(in.eof()); assert(s == L" ghij"); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_STD_VER >= 11 #ifndef TEST_HAS_NO_EXCEPTIONS { std::basic_stringbuf sb("hello"); @@ -98,6 +102,7 @@ assert(threw); assert(s == "hello"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::basic_stringbuf sb(L"hello"); std::basic_istream is(&sb); @@ -117,6 +122,7 @@ assert(threw); assert(s == L"hello"); } +#endif { std::basic_stringbuf sb; @@ -137,6 +143,7 @@ assert(threw); assert(s == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::basic_stringbuf sb; std::basic_istream is(&sb); @@ -156,6 +163,7 @@ assert(threw); assert(s == L""); } +#endif #endif // TEST_HAS_NO_EXCEPTIONS return 0; diff --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp @@ -38,6 +38,7 @@ assert(in.eof()); assert(s == " ghij"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream in(L" abc* def** ghij"); std::wstring s(L"initial text"); @@ -54,6 +55,7 @@ assert(in.eof()); assert(s == L" ghij"); } +#endif #if TEST_STD_VER >= 11 { typedef std::basic_string, min_allocator> S; @@ -72,6 +74,7 @@ assert(in.eof()); assert(s == " ghij"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::basic_string, min_allocator> S; std::wistringstream in(L" abc* def** ghij"); @@ -89,7 +92,8 @@ assert(in.eof()); assert(s == L" ghij"); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_STD_VER >= 11 #ifndef TEST_HAS_NO_EXCEPTIONS { std::basic_stringbuf sb("hello"); @@ -110,6 +114,7 @@ assert(threw); assert(s == "hello"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::basic_stringbuf sb(L"hello"); std::basic_istream is(&sb); @@ -129,6 +134,7 @@ assert(threw); assert(s == L"hello"); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS { std::basic_stringbuf sb; std::basic_istream is(&sb); @@ -148,6 +154,7 @@ assert(threw); assert(s == ""); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::basic_stringbuf sb; std::basic_istream is(&sb); @@ -167,6 +174,7 @@ assert(threw); assert(s == L""); } +#endif // TEST_HAS_NO_WIDE_CHARACTERS #endif // TEST_HAS_NO_EXCEPTIONS return 0; diff --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp @@ -27,23 +27,27 @@ getline(std::istringstream(" abc* def* ghij"), s, '*'); assert(s == " abc"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s(L"initial text"); getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); assert(s == L" abc"); } +#endif { typedef std::basic_string, min_allocator > S; S s("initial text"); getline(std::istringstream(" abc* def* ghij"), s, '*'); assert(s == " abc"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::basic_string, min_allocator > S; S s(L"initial text"); getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); assert(s == L" abc"); } +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp @@ -27,23 +27,27 @@ getline(std::istringstream(" abc\n def\n ghij"), s); assert(s == " abc"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s(L"initial text"); getline(std::wistringstream(L" abc\n def\n ghij"), s); assert(s == L" abc"); } +#endif { typedef std::basic_string, min_allocator > S; S s("initial text"); getline(std::istringstream(" abc\n def\n ghij"), s); assert(s == " abc"); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::basic_string, min_allocator > S; S s(L"initial text"); getline(std::wistringstream(L" abc\n def\n ghij"), s); assert(s == L" abc"); } +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp @@ -44,6 +44,7 @@ in >> s; assert(in.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wistringstream in(L"a bc defghij"); std::wstring s(L"initial text"); @@ -66,6 +67,7 @@ in >> s; assert(in.fail()); } +#endif #ifndef TEST_HAS_NO_EXCEPTIONS { std::stringbuf sb; @@ -128,6 +130,7 @@ in >> s; assert(in.fail()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::basic_string, min_allocator> S; std::wistringstream in(L"a bc defghij"); @@ -151,7 +154,8 @@ in >> s; assert(in.fail()); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_STD_VER >= 11 return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp @@ -37,6 +37,7 @@ assert(out.good()); assert(" " + s == out.str()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream out; std::wstring s(L"some text"); @@ -52,6 +53,7 @@ assert(out.good()); assert(L" " + s == out.str()); } +#endif #if TEST_STD_VER >= 11 { typedef std::basic_string, min_allocator> S; @@ -70,6 +72,7 @@ assert(out.good()); assert(" " + s == out.str()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { typedef std::basic_string, min_allocator> S; std::basic_ostringstream out; @@ -87,7 +90,8 @@ assert(out.good()); assert(L" " + s == out.str()); } -#endif +#endif // TEST_HAS_NO_WIDE_CHARACTERS +#endif // TEST_STD_VER >= 11 return 0; } diff --git a/libcxx/test/std/strings/c.strings/cwchar.pass.cpp b/libcxx/test/std/strings/c.strings/cwchar.pass.cpp --- a/libcxx/test/std/strings/c.strings/cwchar.pass.cpp +++ b/libcxx/test/std/strings/c.strings/cwchar.pass.cpp @@ -8,6 +8,8 @@ // +// XFAIL: libcpp-has-no-wide-characters + #include #include #include diff --git a/libcxx/test/std/strings/c.strings/cwctype.pass.cpp b/libcxx/test/std/strings/c.strings/cwctype.pass.cpp --- a/libcxx/test/std/strings/c.strings/cwctype.pass.cpp +++ b/libcxx/test/std/strings/c.strings/cwctype.pass.cpp @@ -8,6 +8,8 @@ // +// XFAIL: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp @@ -13,6 +13,8 @@ // static void assign(char_type& c1, const char_type& c2); // constexpr in C++17 +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp @@ -12,6 +12,8 @@ // static char_type* assign(char_type* s, size_t n, char_type a); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp @@ -13,6 +13,8 @@ // static int compare(const char_type* s1, const char_type* s2, size_t n); // constexpr in C++17 +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp @@ -12,6 +12,8 @@ // static char_type* copy(char_type* s1, const char_type* s2, size_t n); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp @@ -12,6 +12,8 @@ // static constexpr int_type eof(); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp @@ -12,6 +12,8 @@ // static constexpr bool eq(char_type c1, char_type c2); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp @@ -12,6 +12,8 @@ // static constexpr bool eq_int_type(int_type c1, int_type c2); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp @@ -13,6 +13,8 @@ // static const char_type* find(const char_type* s, size_t n, const char_type& a); // constexpr in C++17 +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp @@ -13,6 +13,8 @@ // static size_t length(const char_type* s); // constexpr in C++17 +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp @@ -12,6 +12,8 @@ // static constexpr bool lt(char_type c1, char_type c2); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp @@ -12,6 +12,8 @@ // static char_type* move(char_type* s1, const char_type* s2, size_t n); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp @@ -12,6 +12,8 @@ // static constexpr int_type not_eof(int_type c); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp @@ -12,6 +12,8 @@ // static constexpr char_type to_char_type(int_type c); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp @@ -12,6 +12,8 @@ // static constexpr int_type to_int_type(char_type c); +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp --- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp +++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp @@ -16,6 +16,8 @@ // typedef streampos pos_type; // typedef mbstate_t state_type; +// UNSUPPORTED: libcpp-has-no-wide-characters + #include #include diff --git a/libcxx/test/std/strings/string.classes/typedefs.pass.cpp b/libcxx/test/std/strings/string.classes/typedefs.pass.cpp --- a/libcxx/test/std/strings/string.classes/typedefs.pass.cpp +++ b/libcxx/test/std/strings/string.classes/typedefs.pass.cpp @@ -25,7 +25,9 @@ int main(int, char**) { static_assert((std::is_same >::value), ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert((std::is_same >::value), ""); +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L static_assert((std::is_same >::value), ""); #endif diff --git a/libcxx/test/std/strings/string.conversions/stod.pass.cpp b/libcxx/test/std/strings/string.conversions/stod.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stod.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stod.pass.cpp @@ -20,171 +20,140 @@ int main(int, char**) { - assert(std::stod("0") == 0); - assert(std::stod(L"0") == 0); - assert(std::stod("-0") == 0); - assert(std::stod(L"-0") == 0); - assert(std::stod("-10") == -10); - assert(std::stod(L"-10.5") == -10.5); - assert(std::stod(" 10") == 10); - assert(std::stod(L" 10") == 10); - size_t idx = 0; - assert(std::stod("10g", &idx) == 10); - assert(idx == 2); - idx = 0; - assert(std::stod(L"10g", &idx) == 10); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif - { - assert(std::stod("1.e60", &idx) == 1.e60); - assert(idx == 5); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } - try -#endif - { - assert(std::stod(L"1.e60", &idx) == 1.e60); - assert(idx == 5); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } - idx = 0; - try - { - assert(std::stod("1.e360", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) - { - assert(idx == 0); - } - try - { - assert(std::stod(L"1.e360", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) - { - assert(idx == 0); - } - try -#endif - { - assert(std::stod("INF", &idx) == INFINITY); - assert(idx == 3); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif - { - assert(std::stod(L"INF", &idx) == INFINITY); - assert(idx == 3); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif - { - assert(std::isnan(std::stod("NAN", &idx))); - assert(idx == 3); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } -#endif - idx = 0; + // char + { + assert(std::stod("0") == 0); + assert(std::stod("-0") == 0); + assert(std::stod("-10") == -10); + assert(std::stod(" 10") == 10); + { + size_t idx = 0; + assert(std::stod("10g", &idx) == 10); + assert(idx == 2); + } + { + size_t idx = 0; + assert(std::stod("1.e60", &idx) == 1.e60); + assert(idx == 5); + } + { + size_t idx = 0; + assert(std::stod("INF", &idx) == INFINITY); + assert(idx == 3); + } + { + size_t idx = 0; + assert(std::isnan(std::stod("NAN", &idx))); + assert(idx == 3); + } + #ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif - { - assert(std::isnan(std::stod(L"NAN", &idx))); - assert(idx == 3); + { + size_t idx = 0; + try { + assert(std::stod("1.e360", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stod("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stod(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stod("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS } + + // wchar_t +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + assert(std::stod(L"0") == 0); + assert(std::stod(L"-0") == 0); + assert(std::stod(L"-10.5") == -10.5); + assert(std::stod(L" 10") == 10); + { + size_t idx = 0; + assert(std::stod(L"10g", &idx) == 10); + assert(idx == 2); + } + { + size_t idx = 0; + assert(std::stod(L"1.e60", &idx) == 1.e60); + assert(idx == 5); + } + { + size_t idx = 0; + assert(std::stod(L"INF", &idx) == INFINITY); + assert(idx == 3); + } + { + size_t idx = 0; + assert(std::isnan(std::stod(L"NAN", &idx))); + assert(idx == 3); + } #ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } - idx = 0; - try - { - std::stod("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stod(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stod(" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stod(L" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stod("a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stod(L"a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } -#endif + { + size_t idx = 0; + try { + assert(std::stod(L"1.e360", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stod(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stod(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stod(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS + } +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/stof.pass.cpp b/libcxx/test/std/strings/string.conversions/stof.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stof.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stof.pass.cpp @@ -21,167 +21,140 @@ int main(int, char**) { assert(std::stof("0") == 0); - assert(std::stof(L"0") == 0); assert(std::stof("-0") == 0); - assert(std::stof(L"-0") == 0); assert(std::stof("-10") == -10); - assert(std::stof(L"-10.5") == -10.5); assert(std::stof(" 10") == 10); - assert(std::stof(L" 10") == 10); - size_t idx = 0; - assert(std::stof("10g", &idx) == 10); - assert(idx == 2); - idx = 0; - assert(std::stof(L"10g", &idx) == 10); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - idx = 0; - try - { - assert(std::stof("1.e60", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) - { - assert(idx == 0); - } - try - { - assert(std::stof(L"1.e60", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) - { - assert(idx == 0); - } - idx = 0; - try - { - assert(std::stof("1.e360", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) - { - assert(idx == 0); - } - try - { - assert(std::stof(L"1.e360", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) { - assert(idx == 0); + size_t idx = 0; + assert(std::stof("10g", &idx) == 10); + assert(idx == 2); } - try -#endif { + size_t idx = 0; assert(std::stof("INF", &idx) == INFINITY); assert(idx == 3); } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif { - assert(std::stof(L"INF", &idx) == INFINITY); + size_t idx = 0; + assert(std::isnan(std::stof("NAN", &idx))); assert(idx == 3); } #ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) { - assert(false); - } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif + size_t idx = 0; + try { + assert(std::stof("1.e60", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + assert(std::stof("1.e360", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stof("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stof(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stof("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::stof(L"0") == 0); + assert(std::stof(L"-0") == 0); + assert(std::stof(L"-10.5") == -10.5); + assert(std::stof(L" 10") == 10); { - assert(std::isnan(std::stof("NAN", &idx))); - assert(idx == 3); + size_t idx = 0; + assert(std::stof(L"10g", &idx) == 10); + assert(idx == 2); } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) { - assert(false); + size_t idx = 0; + assert(std::stof(L"INF", &idx) == INFINITY); + assert(idx == 3); } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif { + size_t idx = 0; assert(std::isnan(std::stof(L"NAN", &idx))); assert(idx == 3); } #ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } - idx = 0; - try - { - std::stof("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stof(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try { - std::stof(" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stof(L" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stof("a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stof(L"a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } -#endif + size_t idx = 0; + try { + assert(std::stof(L"1.e60", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + assert(std::stof(L"1.e360", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stof(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stof(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stof(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/stoi.pass.cpp b/libcxx/test/std/strings/string.conversions/stoi.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stoi.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stoi.pass.cpp @@ -20,95 +20,102 @@ int main(int, char**) { assert(std::stoi("0") == 0); - assert(std::stoi(L"0") == 0); assert(std::stoi("-0") == 0); - assert(std::stoi(L"-0") == 0); assert(std::stoi("-10") == -10); - assert(std::stoi(L"-10") == -10); assert(std::stoi(" 10") == 10); - assert(std::stoi(L" 10") == 10); - size_t idx = 0; - assert(std::stoi("10g", &idx, 16) == 16); - assert(idx == 2); - idx = 0; - assert(std::stoi(L"10g", &idx, 16) == 16); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - if (std::numeric_limits::max() > std::numeric_limits::max()) { - try - { + size_t idx = 0; + assert(std::stoi("10g", &idx, 16) == 16); + assert(idx == 2); + } +#ifndef TEST_HAS_NO_EXCEPTIONS + if (std::numeric_limits::max() > std::numeric_limits::max()) { + size_t idx = 0; + try { std::stoi("0x100000000", &idx, 16); assert(false); + } catch (const std::out_of_range&) { + } - catch (const std::out_of_range&) - { - } - try - { - std::stoi(L"0x100000000", &idx, 16); - assert(false); - } - catch (const std::out_of_range&) - { - } - } - idx = 0; - try - { - std::stoi("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); } - try { - std::stoi(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoi(" - 8", &idx); - assert(false); + size_t idx = 0; + try { + std::stoi("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } } - catch (const std::invalid_argument&) { - assert(idx == 0); + size_t idx = 0; + try { + std::stoi(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } } - try { - std::stoi(L" - 8", &idx); - assert(false); + size_t idx = 0; + try { + std::stoi("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } } - catch (const std::invalid_argument&) +#endif // TEST_HAS_NO_EXCEPTIONS + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::stoi(L"0") == 0); + assert(std::stoi(L"-0") == 0); + assert(std::stoi(L"-10") == -10); + assert(std::stoi(L" 10") == 10); { - assert(idx == 0); + size_t idx = 0; + assert(std::stoi(L"10g", &idx, 16) == 16); + assert(idx == 2); } - try - { - std::stoi("a1", &idx); - assert(false); +#ifndef TEST_HAS_NO_EXCEPTIONS + if (std::numeric_limits::max() > std::numeric_limits::max()) { + size_t idx = 0; + try { + std::stoi(L"0x100000000", &idx, 16); + assert(false); + } catch (const std::out_of_range&) { + + } } - catch (const std::invalid_argument&) { - assert(idx == 0); + size_t idx = 0; + try { + std::stoi(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } } - try { - std::stoi(L"a1", &idx); - assert(false); + size_t idx = 0; + try { + std::stoi(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } } - catch (const std::invalid_argument&) { - assert(idx == 0); + size_t idx = 0; + try { + std::stoi(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } } -#endif +#endif // TEST_HAS_NO_EXCEPTIONS +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/stol.pass.cpp b/libcxx/test/std/strings/string.conversions/stol.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stol.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stol.pass.cpp @@ -20,96 +20,104 @@ int main(int, char**) { assert(std::stol("0") == 0); - assert(std::stol(L"0") == 0); assert(std::stol("-0") == 0); - assert(std::stol(L"-0") == 0); assert(std::stol("-10") == -10); - assert(std::stol(L"-10") == -10); assert(std::stol(" 10") == 10); - assert(std::stol(L" 10") == 10); - size_t idx = 0; - assert(std::stol("10g", &idx, 16) == 16); - assert(idx == 2); - idx = 0; - assert(std::stol(L"10g", &idx, 16) == 16); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - idx = 0; - try - { - std::stol("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stol(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stol(" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stol(L" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) { - assert(idx == 0); + size_t idx = 0; + assert(std::stol("10g", &idx, 16) == 16); + assert(idx == 2); } - try - { - std::stol("a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stol(L"a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - // LWG#2009 and PR14919 - std::stol("9999999999999999999999999999999999999999999999999", &idx); - assert(false); - } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } - try + size_t idx = 0; + try { + std::stol("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stol(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stol("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stol("9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::stol(L"0") == 0); + assert(std::stol(L"-0") == 0); + assert(std::stol(L"-10") == -10); + assert(std::stol(L" 10") == 10); { - // LWG#2009 and PR14919 - std::stol(L"9999999999999999999999999999999999999999999999999", &idx); - assert(false); + size_t idx = 0; + assert(std::stol(L"10g", &idx, 16) == 16); + assert(idx == 2); } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } -#endif + size_t idx = 0; + try { + std::stol(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stol(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stol(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stol(L"9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/stold.pass.cpp b/libcxx/test/std/strings/string.conversions/stold.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stold.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stold.pass.cpp @@ -21,172 +21,133 @@ int main(int, char**) { assert(std::stold("0") == 0); - assert(std::stold(L"0") == 0); assert(std::stold("-0") == 0); - assert(std::stold(L"-0") == 0); assert(std::stold("-10") == -10); - assert(std::stold(L"-10.5") == -10.5); assert(std::stold(" 10") == 10); - assert(std::stold(L" 10") == 10); - size_t idx = 0; - assert(std::stold("10g", &idx) == 10); - assert(idx == 2); - idx = 0; - assert(std::stold(L"10g", &idx) == 10); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif - { - assert(std::stold("1.e60", &idx) == 1.e60L); - assert(idx == 5); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) { - assert(false); + size_t idx = 0; + assert(std::stold("10g", &idx) == 10); + assert(idx == 2); } - try -#endif { - assert(std::stold(L"1.e60", &idx) == 1.e60L); + size_t idx = 0; + assert(std::stold("1.e60", &idx) == 1.e60L); assert(idx == 5); } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try - { - assert(std::stold("1.e6000", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) - { - assert(idx == 0); - } - try - { - assert(std::stold(L"1.e6000", &idx) == INFINITY); - assert(false); - } - catch (const std::out_of_range&) - { - assert(idx == 0); - } - try -#endif { + size_t idx = 0; assert(std::stold("INF", &idx) == INFINITY); assert(idx == 3); } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif { - assert(std::stold(L"INF", &idx) == INFINITY); + size_t idx = 0; + assert(std::isnan(std::stold("NAN", &idx))); assert(idx == 3); } + #ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) { - assert(false); + size_t idx = 0; + try { + std::stold("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stold(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stold("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + assert(std::stold("1.e6000", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::stold(L"0") == 0); + assert(std::stold(L"-0") == 0); + assert(std::stold(L"-10.5") == -10.5); + assert(std::stold(L" 10") == 10); + { + size_t idx = 0; + assert(std::stold(L"10g", &idx) == 10); + assert(idx == 2); } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif { - assert(std::isnan(std::stold("NAN", &idx))); - assert(idx == 3); + size_t idx = 0; + assert(std::stold(L"1.e60", &idx) == 1.e60L); + assert(idx == 5); } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) { - assert(false); + size_t idx = 0; + assert(std::stold(L"INF", &idx) == INFINITY); + assert(idx == 3); } -#endif - idx = 0; -#ifndef TEST_HAS_NO_EXCEPTIONS - try -#endif { + size_t idx = 0; assert(std::isnan(std::stold(L"NAN", &idx))); assert(idx == 3); } #ifndef TEST_HAS_NO_EXCEPTIONS - catch (const std::out_of_range&) - { - assert(false); - } - idx = 0; - try - { - std::stold("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stold(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) { - assert(idx == 0); - } - try - { - std::stold(" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stold(L" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stold("a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stold(L"a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } -#endif + size_t idx = 0; + try { + std::stold(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stold(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stold(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + assert(std::stold(L"1.e6000", &idx) == INFINITY); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/stoll.pass.cpp b/libcxx/test/std/strings/string.conversions/stoll.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stoll.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stoll.pass.cpp @@ -20,96 +20,104 @@ int main(int, char**) { assert(std::stoll("0") == 0); - assert(std::stoll(L"0") == 0); assert(std::stoll("-0") == 0); - assert(std::stoll(L"-0") == 0); assert(std::stoll("-10") == -10); - assert(std::stoll(L"-10") == -10); assert(std::stoll(" 10") == 10); - assert(std::stoll(L" 10") == 10); - size_t idx = 0; - assert(std::stoll("10g", &idx, 16) == 16); - assert(idx == 2); - idx = 0; - assert(std::stoll(L"10g", &idx, 16) == 16); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - idx = 0; - try - { - std::stoll("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoll(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoll(" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoll(L" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) { - assert(idx == 0); + size_t idx = 0; + assert(std::stoll("10g", &idx, 16) == 16); + assert(idx == 2); } - try - { - std::stoll("a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoll(L"a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - // LWG#2009 and PR14919 - std::stoll("99999999999999999999999999", &idx); - assert(false); - } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } - try + size_t idx = 0; + try { + std::stoll("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoll(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoll("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stoll("99999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::stoll(L"0") == 0); + assert(std::stoll(L"-0") == 0); + assert(std::stoll(L"-10") == -10); + assert(std::stoll(L" 10") == 10); { - // LWG#2009 and PR14919 - std::stoll(L"99999999999999999999999999", &idx); - assert(false); + size_t idx = 0; + assert(std::stoll(L"10g", &idx, 16) == 16); + assert(idx == 2); } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } -#endif + size_t idx = 0; + try { + std::stoll(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoll(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoll(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stoll(L"99999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/stoul.pass.cpp b/libcxx/test/std/strings/string.conversions/stoul.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stoul.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stoul.pass.cpp @@ -20,94 +20,102 @@ int main(int, char**) { assert(std::stoul("0") == 0); - assert(std::stoul(L"0") == 0); assert(std::stoul("-0") == 0); - assert(std::stoul(L"-0") == 0); assert(std::stoul(" 10") == 10); - assert(std::stoul(L" 10") == 10); - size_t idx = 0; - assert(std::stoul("10g", &idx, 16) == 16); - assert(idx == 2); - idx = 0; - assert(std::stoul(L"10g", &idx, 16) == 16); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - idx = 0; - try - { - std::stoul("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoul(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoul(" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoul(L" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) { - assert(idx == 0); + size_t idx = 0; + assert(std::stoul("10g", &idx, 16) == 16); + assert(idx == 2); } - try - { - std::stoul("a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoul(L"a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - // LWG#2009 and PR14919 - std::stoul("9999999999999999999999999999999999999999999999999", &idx); - assert(false); - } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } - try + size_t idx = 0; + try { + std::stoul("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoul(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoul("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stoul("9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::stoul(L"0") == 0); + assert(std::stoul(L"-0") == 0); + assert(std::stoul(L" 10") == 10); { - // LWG#2009 and PR14919 - std::stoul(L"9999999999999999999999999999999999999999999999999", &idx); - assert(false); + size_t idx = 0; + assert(std::stoul(L"10g", &idx, 16) == 16); + assert(idx == 2); } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } -#endif + size_t idx = 0; + try { + std::stoul(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoul(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoul(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stoul(L"9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/stoull.pass.cpp b/libcxx/test/std/strings/string.conversions/stoull.pass.cpp --- a/libcxx/test/std/strings/string.conversions/stoull.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/stoull.pass.cpp @@ -20,95 +20,102 @@ int main(int, char**) { assert(std::stoull("0") == 0); - assert(std::stoull(L"0") == 0); assert(std::stoull("-0") == 0); - assert(std::stoull(L"-0") == 0); assert(std::stoull(" 10") == 10); - assert(std::stoull(L" 10") == 10); - size_t idx = 0; - assert(std::stoull("10g", &idx, 16) == 16); - assert(idx == 2); - idx = 0; - assert(std::stoull(L"10g", &idx, 16) == 16); - assert(idx == 2); -#ifndef TEST_HAS_NO_EXCEPTIONS - idx = 0; - try - { - std::stoull("", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - idx = 0; - try - { - std::stoull(L"", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoull(" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoull(L" - 8", &idx); - assert(false); - } - catch (const std::invalid_argument&) { - assert(idx == 0); + size_t idx = 0; + assert(std::stoull("10g", &idx, 16) == 16); + assert(idx == 2); } - try - { - std::stoull("a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - std::stoull(L"a1", &idx); - assert(false); - } - catch (const std::invalid_argument&) - { - assert(idx == 0); - } - try - { - // LWG#2009 and PR14919 - std::stoull("9999999999999999999999999999999999999999999999999", &idx); - assert(false); - } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } - try + size_t idx = 0; + try { + std::stoull("", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoull(" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoull("a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stoull("9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert(std::stoull(L"0") == 0); + assert(std::stoull(L"-0") == 0); + assert(std::stoull(L" 10") == 10); { - // LWG#2009 and PR14919 - std::stoull(L"9999999999999999999999999999999999999999999999999", &idx); - assert(false); + size_t idx = 0; + assert(std::stoull(L"10g", &idx, 16) == 16); + assert(idx == 2); } - catch (const std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS { - assert(idx == 0); - } -#endif + size_t idx = 0; + try { + std::stoull(L"", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoull(L" - 8", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + std::stoull(L"a1", &idx); + assert(false); + } catch (const std::invalid_argument&) { + assert(idx == 0); + } + } + { + size_t idx = 0; + try { + // LWG#2009 and PR14919 + std::stoull(L"9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } catch (const std::out_of_range&) { + assert(idx == 0); + } + } +#endif // TEST_HAS_NO_EXCEPTIONS +#endif // TEST_HAS_NO_WIDE_CHARACTERS return 0; } diff --git a/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp b/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp --- a/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp +++ b/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-wide-characters + // // wstring to_wstring(int val); diff --git a/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp b/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp @@ -23,7 +23,9 @@ test_library_hash_specializations_available(); { test_hash_enabled_for_type(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_hash_enabled_for_type(); +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test_hash_enabled_for_type(); #endif diff --git a/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp b/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp @@ -65,7 +65,9 @@ test(); test(); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp @@ -68,17 +68,21 @@ #endif test1 (); test1 (); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test1 (); +#endif test2 ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 ); test2 ( "ABCDE", 5 ); test2 ( "a", 1 ); test2 ( "", 0 ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test2 ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 ); test2 ( L"ABCDE", 5 ); test2 ( L"a", 1 ); test2 ( L"", 0 ); +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test2 ( u8"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 ); diff --git a/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp @@ -35,23 +35,27 @@ assert( test (u8"1234")); #endif #if TEST_STD_VER >= 11 -#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS +# ifndef _LIBCPP_HAS_NO_UNICODE_CHARS assert( test ( u"1234")); assert( test ( U"1234")); +# endif #endif -#endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert( test ( L"1234")); +#endif #if TEST_STD_VER > 11 static_assert( test ({ "abc", 3}), ""); -#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L +# if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L static_assert( test ({u8"abc", 3}), ""); -#endif -#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS +# endif +# ifndef _LIBCPP_HAS_NO_UNICODE_CHARS static_assert( test ({ u"abc", 3}), ""); static_assert( test ({ U"abc", 3}), ""); -#endif +# endif +# ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert( test ({ L"abc", 3}), ""); +# endif #endif return 0; diff --git a/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp @@ -31,7 +31,9 @@ constexpr void test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif test(); test(); test(); diff --git a/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp @@ -41,8 +41,9 @@ test (); #endif test (); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test (); - +#endif return 0; } diff --git a/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp @@ -32,7 +32,9 @@ constexpr bool test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif test(); test(); test(); diff --git a/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp @@ -36,9 +36,11 @@ test ( std::string("") ); test ( std::string() ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( std::wstring(L"QBCDE") ); test ( std::wstring(L"") ); test ( std::wstring() ); +#endif #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test ( std::u8string{u8"QBCDE"} ); diff --git a/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp @@ -36,29 +36,35 @@ ASSERT_SAME_TYPE(decltype(s), std::string_view); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS using WSV = std::basic_string_view>; const WSV win(L"abcdef"); std::basic_string_view w(win); ASSERT_SAME_TYPE(decltype(w), WSV); assert(w == L"abcdef"); +#endif } { // Testing (3) std::basic_string_view s("abc", 2); ASSERT_SAME_TYPE(decltype(s), std::string_view); assert(s == "ab"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string_view w(L"abcdef", 4); ASSERT_SAME_TYPE(decltype(w), std::wstring_view); assert(w == L"abcd"); +#endif } { // Testing (4) std::basic_string_view s("abc"); ASSERT_SAME_TYPE(decltype(s), std::string_view); assert(s == "abc"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::basic_string_view w(L"abcdef"); ASSERT_SAME_TYPE(decltype(w), std::wstring_view); assert(w == L"abcdef"); +#endif } return 0; diff --git a/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp b/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp @@ -21,14 +21,11 @@ #include "test_macros.h" -using std::string_view; -using std::wstring_view; - int main(int, char**) { { std::ostringstream out; - string_view sv("some text"); + std::string_view sv("some text"); out << sv; assert(out.good()); assert(sv == out.str()); @@ -36,15 +33,16 @@ { std::ostringstream out; std::string s("some text"); - string_view sv(s); + std::string_view sv(s); out.width(12); out << sv; assert(out.good()); assert(" " + s == out.str()); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wostringstream out; - wstring_view sv(L"some text"); + std::wstring_view sv(L"some text"); out << sv; assert(out.good()); assert(sv == out.str()); @@ -52,12 +50,13 @@ { std::wostringstream out; std::wstring s(L"some text"); - wstring_view sv(s); + std::wstring_view sv(s); out.width(12); out << sv; assert(out.good()); assert(L" " + s == out.str()); } +#endif return 0; } diff --git a/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp @@ -47,14 +47,11 @@ #endif typedef std::u16string_view u16string_view; typedef std::u32string_view u32string_view; - typedef std::wstring_view wstring_view; test(string_view ()); test(u16string_view()); test(u32string_view()); - test(wstring_view ()); test(string_view ( "123")); - test(wstring_view (L"123")); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test(u8string_view{u8"123"}); #endif @@ -63,6 +60,12 @@ test(u32string_view{U"123"}); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + typedef std::wstring_view wstring_view; + test(wstring_view ()); + test(wstring_view (L"123")); +#endif + #if TEST_STD_VER > 11 { constexpr string_view sv { "123", 3 }; @@ -71,7 +74,6 @@ #endif constexpr u16string_view u16sv {u"123", 3 }; constexpr u32string_view u32sv {U"123", 3 }; - constexpr wstring_view wsv {L"123", 3 }; static_assert ( *sv.begin() == sv[0], "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -79,7 +81,6 @@ #endif static_assert ( *u16sv.begin() == u16sv[0], "" ); static_assert ( *u32sv.begin() == u32sv[0], "" ); - static_assert ( *wsv.begin() == wsv[0], "" ); static_assert ( *sv.cbegin() == sv[0], "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -87,9 +88,16 @@ #endif static_assert ( *u16sv.cbegin() == u16sv[0], "" ); static_assert ( *u32sv.cbegin() == u32sv[0], "" ); - static_assert ( *wsv.cbegin() == wsv[0], "" ); - } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + constexpr wstring_view wsv {L"123", 3 }; + static_assert ( *wsv.begin() == wsv[0], "" ); + static_assert ( *wsv.cbegin() == wsv[0], "" ); + } #endif + } +#endif // TEST_STD_VER > 11 return 0; } diff --git a/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp @@ -56,14 +56,11 @@ #endif typedef std::u16string_view u16string_view; typedef std::u32string_view u32string_view; - typedef std::wstring_view wstring_view; test(string_view ()); test(u16string_view()); test(u32string_view()); - test(wstring_view ()); test(string_view ( "123")); - test(wstring_view (L"123")); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test(u8string_view{u8"123"}); #endif @@ -72,6 +69,12 @@ test(u32string_view{U"123"}); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + typedef std::wstring_view wstring_view; + test(wstring_view ()); + test(wstring_view (L"123")); +#endif + #if TEST_STD_VER > 11 { constexpr string_view sv { "123", 3 }; @@ -80,7 +83,6 @@ #endif constexpr u16string_view u16sv {u"123", 3 }; constexpr u32string_view u32sv {U"123", 3 }; - constexpr wstring_view wsv {L"123", 3 }; static_assert ( sv.begin() != sv.end(), "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -88,7 +90,6 @@ #endif static_assert ( u16sv.begin() != u16sv.end(), "" ); static_assert ( u32sv.begin() != u32sv.end(), "" ); - static_assert ( wsv.begin() != wsv.end(), "" ); static_assert ( sv.begin() != sv.cend(), "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -96,9 +97,16 @@ #endif static_assert ( u16sv.begin() != u16sv.cend(), "" ); static_assert ( u32sv.begin() != u32sv.cend(), "" ); - static_assert ( wsv.begin() != wsv.cend(), "" ); - } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + constexpr wstring_view wsv {L"123", 3 }; + static_assert ( wsv.begin() != wsv.end(), "" ); + static_assert ( wsv.begin() != wsv.cend(), "" ); + } #endif + } +#endif // TEST_STD_VER > 11 return 0; } diff --git a/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp @@ -48,14 +48,11 @@ #endif typedef std::u16string_view u16string_view; typedef std::u32string_view u32string_view; - typedef std::wstring_view wstring_view; test(string_view ()); test(u16string_view()); test(u32string_view()); - test(wstring_view ()); test(string_view ( "123")); - test(wstring_view (L"123")); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test(u8string_view{u8"123"}); #endif @@ -64,6 +61,12 @@ test(u32string_view{U"123"}); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + typedef std::wstring_view wstring_view; + test(wstring_view ()); + test(wstring_view (L"123")); +#endif + #if TEST_STD_VER > 14 { constexpr string_view sv { "123", 3 }; @@ -72,7 +75,6 @@ #endif constexpr u16string_view u16sv {u"123", 3 }; constexpr u32string_view u32sv {U"123", 3 }; - constexpr wstring_view wsv {L"123", 3 }; static_assert ( *sv.rbegin() == sv[2], "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -80,7 +82,6 @@ #endif static_assert ( *u16sv.rbegin() == u16sv[2], "" ); static_assert ( *u32sv.rbegin() == u32sv[2], "" ); - static_assert ( *wsv.rbegin() == wsv[2], "" ); static_assert ( *sv.crbegin() == sv[2], "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -88,9 +89,16 @@ #endif static_assert ( *u16sv.crbegin() == u16sv[2], "" ); static_assert ( *u32sv.crbegin() == u32sv[2], "" ); - static_assert ( *wsv.crbegin() == wsv[2], "" ); - } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + constexpr wstring_view wsv {L"123", 3 }; + static_assert ( *wsv.rbegin() == wsv[2], "" ); + static_assert ( *wsv.crbegin() == wsv[2], "" ); + } #endif + } +#endif // TEST_STD_VER > 14 return 0; } diff --git a/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp @@ -56,14 +56,11 @@ #endif typedef std::u16string_view u16string_view; typedef std::u32string_view u32string_view; - typedef std::wstring_view wstring_view; test(string_view ()); test(u16string_view()); test(u32string_view()); - test(wstring_view ()); test(string_view ( "123")); - test(wstring_view (L"123")); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L test(u8string_view{u8"123"}); #endif @@ -72,6 +69,12 @@ test(u32string_view{U"123"}); #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + typedef std::wstring_view wstring_view; + test(wstring_view ()); + test(wstring_view (L"123")); +#endif + #if TEST_STD_VER > 14 { constexpr string_view sv { "123", 3 }; @@ -80,7 +83,6 @@ #endif constexpr u16string_view u16sv {u"123", 3 }; constexpr u32string_view u32sv {U"123", 3 }; - constexpr wstring_view wsv {L"123", 3 }; static_assert ( *--sv.rend() == sv[0], "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -88,7 +90,6 @@ #endif static_assert ( *--u16sv.rend() == u16sv[0], "" ); static_assert ( *--u32sv.rend() == u32sv[0], "" ); - static_assert ( *--wsv.rend() == wsv[0], "" ); static_assert ( *--sv.crend() == sv[0], "" ); #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L @@ -96,9 +97,16 @@ #endif static_assert ( *--u16sv.crend() == u16sv[0], "" ); static_assert ( *--u32sv.crend() == u32sv[0], "" ); - static_assert ( *--wsv.crend() == wsv[0], "" ); - } + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + { + constexpr wstring_view wsv {L"123", 3 }; + static_assert ( *--wsv.rend() == wsv[0], "" ); + static_assert ( *--wsv.crend() == wsv[0], "" ); + } #endif + } +#endif // TEST_STD_VER > 14 return 0; } diff --git a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp @@ -50,9 +50,11 @@ test ( "a", 1 ); test ( "", 0 ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDE", 5 ); test ( L"a", 1 ); test ( L"", 0 ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDE", 5 ); diff --git a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp @@ -51,9 +51,11 @@ test ( "a", 1 ); test ( "", 0 ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDE", 5 ); test ( L"a", 1 ); test ( L"", 0 ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDE", 5 ); diff --git a/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp @@ -50,9 +50,11 @@ test ( "a", 1 ); test ( "", 0 ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test ( L"ABCDE", 5 ); test ( L"a", 1 ); test ( L"", 0 ); +#endif #if TEST_STD_VER >= 11 test ( u"ABCDE", 5 ); diff --git a/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp b/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp @@ -22,12 +22,13 @@ bool is_skipws ( const std::istream *is ) { return ( is->flags() & std::ios_base::skipws ) != 0; - } - +} +#ifndef TEST_HAS_NO_WIDE_CHARACTERS bool is_skipws ( const std::wistream *is ) { return ( is->flags() & std::ios_base::skipws ) != 0; - } +} +#endif void round_trip ( const char *p ) { std::stringstream ss; @@ -92,7 +93,7 @@ return s; } - +#ifndef TEST_HAS_NO_WIDE_CHARACTERS void round_trip ( const wchar_t *p ) { std::wstringstream ss; bool skippingws = is_skipws ( &ss ); @@ -159,6 +160,7 @@ ss >> std::quoted(s, delim, escape); return s; } +#endif // TEST_HAS_NO_WIDE_CHARACTERS int main(int, char**) { @@ -167,10 +169,12 @@ round_trip_d ( "", 'q' ); round_trip_e ( "", 'q' ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS round_trip ( L"" ); round_trip_ws ( L"" ); round_trip_d ( L"", 'q' ); round_trip_e ( L"", 'q' ); +#endif round_trip ( "Hi" ); round_trip_ws ( "Hi" ); @@ -179,34 +183,42 @@ assert ( quote ( "Hi", '!' ) == "!Hi!" ); assert ( quote ( "Hi!", '!' ) == R"(!Hi\!!)" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS round_trip ( L"Hi" ); round_trip_ws ( L"Hi" ); round_trip_d ( L"Hi", '!' ); round_trip_e ( L"Hi", '!' ); assert ( quote ( L"Hi", '!' ) == L"!Hi!" ); assert ( quote ( L"Hi!", '!' ) == LR"(!Hi\!!)" ); +#endif round_trip ( "Hi Mom" ); round_trip_ws ( "Hi Mom" ); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS round_trip ( L"Hi Mom" ); round_trip_ws ( L"Hi Mom" ); +#endif assert ( quote ( "" ) == "\"\"" ); - assert ( quote ( L"" ) == L"\"\"" ); assert ( quote ( "a" ) == "\"a\"" ); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert ( quote ( L"" ) == L"\"\"" ); assert ( quote ( L"a" ) == L"\"a\"" ); +#endif -// missing end quote - must not hang + // missing end quote - must not hang assert ( unquote ( "\"abc" ) == "abc" ); - assert ( unquote ( L"\"abc" ) == L"abc" ); - assert ( unquote ( "abc" ) == "abc" ); // no delimiter - assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter assert ( unquote ( "abc def" ) == "abc" ); // no delimiter - assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter - assert ( unquote ( "" ) == "" ); // nothing there + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + assert ( unquote ( L"\"abc" ) == L"abc" ); + assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter + assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter assert ( unquote ( L"" ) == L"" ); // nothing there +#endif return 0; } diff --git a/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp b/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp --- a/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp +++ b/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp @@ -27,43 +27,57 @@ ASSERT_SAME_TYPE(decltype( "Hi"sv), std::string_view); ASSERT_SAME_TYPE(decltype(u8"Hi"sv), u8string_view); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ASSERT_SAME_TYPE(decltype( L"Hi"sv), std::wstring_view); +#endif ASSERT_SAME_TYPE(decltype( u"Hi"sv), std::u16string_view); ASSERT_SAME_TYPE(decltype( U"Hi"sv), std::u32string_view); std::string_view foo; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS std::wstring_view Lfoo; +#endif u8string_view u8foo; std::u16string_view ufoo; std::u32string_view Ufoo; foo = ""sv; assert( foo.size() == 0); u8foo = u8""sv; assert(u8foo.size() == 0); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS Lfoo = L""sv; assert( Lfoo.size() == 0); +#endif ufoo = u""sv; assert( ufoo.size() == 0); Ufoo = U""sv; assert( Ufoo.size() == 0); foo = " "sv; assert( foo.size() == 1); u8foo = u8" "sv; assert(u8foo.size() == 1); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS Lfoo = L" "sv; assert( Lfoo.size() == 1); +#endif ufoo = u" "sv; assert( ufoo.size() == 1); Ufoo = U" "sv; assert( Ufoo.size() == 1); foo = "ABC"sv; assert( foo == "ABC"); assert( foo == std::string_view ( "ABC")); u8foo = u8"ABC"sv; assert(u8foo == u8"ABC"); assert(u8foo == u8string_view (u8"ABC")); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS Lfoo = L"ABC"sv; assert( Lfoo == L"ABC"); assert( Lfoo == std::wstring_view ( L"ABC")); +#endif ufoo = u"ABC"sv; assert( ufoo == u"ABC"); assert( ufoo == std::u16string_view( u"ABC")); Ufoo = U"ABC"sv; assert( Ufoo == U"ABC"); assert( Ufoo == std::u32string_view( U"ABC")); static_assert( "ABC"sv.size() == 3, ""); static_assert(u8"ABC"sv.size() == 3, ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert( L"ABC"sv.size() == 3, ""); +#endif static_assert( u"ABC"sv.size() == 3, ""); static_assert( U"ABC"sv.size() == 3, ""); ASSERT_NOEXCEPT( "ABC"sv); ASSERT_NOEXCEPT(u8"ABC"sv); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS ASSERT_NOEXCEPT( L"ABC"sv); +#endif ASSERT_NOEXCEPT( u"ABC"sv); ASSERT_NOEXCEPT( U"ABC"sv); } diff --git a/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp b/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp --- a/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp +++ b/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp @@ -13,8 +13,12 @@ #include #include +#include "test_macros.h" + static_assert(std::is_trivially_copyable >::value, ""); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(std::is_trivially_copyable >::value, ""); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T static_assert(std::is_trivially_copyable >::value, ""); #endif diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp --- a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp @@ -72,7 +72,9 @@ void test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif } int main(int, char**) { diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp --- a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp @@ -8,6 +8,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: libcpp-no-concepts // UNSUPPORTED: libcpp-has-no-incomplete-format +// UNSUPPORTED: libcpp-has-no-wide-characters // Validate it works regardless of the signedness of `char`. // RUN: %{cxx} %{flags} %{compile_flags} -fsigned-char -fsyntax-only %s diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp --- a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp @@ -8,6 +8,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: libcpp-no-concepts // UNSUPPORTED: libcpp-has-no-incomplete-format +// XFAIL: libcpp-has-no-wide-characters // TODO FMT Evaluate gcc-11 status // UNSUPPORTED: gcc-11 diff --git a/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp --- a/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp @@ -57,7 +57,9 @@ void test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif } int main(int, char**) { diff --git a/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp --- a/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp @@ -25,19 +25,23 @@ static_assert(std::is_same_v>); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(std::is_same_v>); +#endif static_assert(std::is_same_v< std::format_args_t, char>, std::basic_format_args, char>>>); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert( std::is_same_v< std::format_args_t, wchar_t>, std::basic_format_args, wchar_t>>>); +#endif static_assert( std::is_same_v< diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp @@ -47,9 +47,11 @@ std::make_format_args>, char>>())); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::basic_format_args( std::make_format_args>, wchar_t>>())); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test(std::basic_format_args( std::make_format_args>, char>(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test>, wchar_t>(); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test>, char8_t>(); #endif diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp @@ -122,7 +122,9 @@ void test() { test>, char>(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test>, wchar_t>(); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test>, char8_t>(); #endif diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp @@ -78,7 +78,9 @@ void test() { test>, char>(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test>, wchar_t>(); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test>, char8_t>(); #endif diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp @@ -43,9 +43,11 @@ test(std::basic_format_args( std::make_format_args>, char>>())); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(std::basic_format_args( std::make_format_args>, wchar_t>>())); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test(std::basic_format_args( std::make_format_args(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_boolean(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp @@ -100,8 +100,10 @@ int main(int, char**) { test_char_pointer(); test_char_pointer(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_char_pointer(); test_char_pointer(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp @@ -76,8 +76,10 @@ int main(int, char**) { test_char_type(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_char_type(); test_char_type(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp @@ -114,7 +114,9 @@ int main(int, char**) { test_array(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_array(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp @@ -113,7 +113,9 @@ int main(int, char**) { test_all_float_types(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_all_float_types(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp @@ -115,7 +115,9 @@ int main(int, char**) { test_all_signed_integral_types(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_all_signed_integral_types(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp @@ -118,7 +118,9 @@ int main(int, char**) { test_all_string_types(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_all_string_types(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp @@ -103,7 +103,9 @@ int main(int, char**) { test_all_unsigned_integral_types(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test_all_unsigned_integral_types(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp @@ -99,7 +99,9 @@ constexpr void test() { test>, char>(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test>, wchar_t>(); +#endif test>, char8_t>(); test>, char16_t>(); test>, char32_t>(); @@ -109,11 +111,13 @@ std::format_context, std::basic_format_context< std::back_insert_iterator>, char>>); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert( std::is_same_v< std::wformat_context, std::basic_format_context< std::back_insert_iterator>, wchar_t>>); +#endif // Required for MSVC internal test runner compatibility. int main(int, char**) { return 0; } diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp @@ -47,7 +47,9 @@ constexpr void test() { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T test(); #endif @@ -59,8 +61,10 @@ static_assert(std::is_same_v >); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(std::is_same_v >); +#endif // Required for MSVC internal test runner compatibility. int main(int, char**) { return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp @@ -66,10 +66,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/format.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/format.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/format.pass.cpp @@ -75,10 +75,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/format_tests.h b/libcxx/test/std/utilities/format/format.functions/format_tests.h --- a/libcxx/test/std/utilities/format/format.functions/format_tests.h +++ b/libcxx/test/std/utilities/format/format.functions/format_tests.h @@ -1100,10 +1100,12 @@ #endif } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS template void format_tests_char_to_wchar_t(TestFunction check) { using CharT = wchar_t; check(STR("hello 09azA"), STR("hello {}{}{}{}{}"), '0', '9', 'a', 'z', 'A'); } +#endif #endif diff --git a/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp @@ -81,10 +81,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp @@ -82,10 +82,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp @@ -119,10 +119,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp @@ -115,10 +115,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp @@ -54,10 +54,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp b/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp @@ -51,10 +51,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp @@ -105,6 +105,7 @@ char do_thousands_sep() const override { return '_'; } }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS template <> struct numpunct : std::numpunct { string_type do_truename() const override { return L"yes"; } @@ -113,6 +114,7 @@ std::string do_grouping() const override { return "\1\2\3\2\1"; }; wchar_t do_thousands_sep() const override { return L'_'; } }; +#endif template void test(std::basic_string expected, std::basic_string fmt, @@ -237,12 +239,14 @@ string_type do_falsename() const override { return "ungültig"; } }; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS template <> struct numpunct_unicode : std::numpunct { string_type do_truename() const override { return L"gültig"; } string_type do_falsename() const override { return L"ungültig"; } }; #endif +#endif // _LIBCPP_HAS_NO_UNICODE template void test_bool() { @@ -613,7 +617,9 @@ int main(int, char**) { test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp @@ -58,10 +58,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp @@ -55,10 +55,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp @@ -97,10 +97,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp @@ -100,10 +100,12 @@ }; int main(int, char**) { - format_tests_char_to_wchar_t(test); - format_tests(test, test_exception); + +#ifndef TEST_HAS_NO_WIDE_CHARACTERS + format_tests_char_to_wchar_t(test); format_tests(test, test_exception); +#endif return 0; } diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp --- a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp @@ -58,7 +58,9 @@ test(); test(); test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif test(); test(); test(); diff --git a/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp --- a/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp +++ b/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp @@ -47,6 +47,7 @@ std::vector > const cases = get_test_cases(); for (std::size_t c = 0; c != cases.size(); ++c) { std::bitset const v = cases[c]; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s = v.template to_string, std::allocator >(); check_equal(s, v, L'0', L'1'); @@ -55,6 +56,7 @@ std::wstring s = v.template to_string >(); check_equal(s, v, L'0', L'1'); } +#endif { std::string s = v.template to_string(); check_equal(s, v, '0', '1'); @@ -63,6 +65,7 @@ std::string s = v.to_string(); check_equal(s, v, '0', '1'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s = v.template to_string, std::allocator >('0'); check_equal(s, v, L'0', L'1'); @@ -71,6 +74,7 @@ std::wstring s = v.template to_string >('0'); check_equal(s, v, L'0', L'1'); } +#endif { std::string s = v.template to_string('0'); check_equal(s, v, '0', '1'); @@ -79,6 +83,7 @@ std::string s = v.to_string('0'); check_equal(s, v, '0', '1'); } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS { std::wstring s = v.template to_string, std::allocator >('0', '1'); check_equal(s, v, L'0', L'1'); @@ -87,6 +92,7 @@ std::wstring s = v.template to_string >('0', '1'); check_equal(s, v, L'0', L'1'); } +#endif { std::string s = v.template to_string('0', '1'); check_equal(s, v, '0', '1'); diff --git a/libcxx/test/std/utilities/template.bitset/includes.pass.cpp b/libcxx/test/std/utilities/template.bitset/includes.pass.cpp --- a/libcxx/test/std/utilities/template.bitset/includes.pass.cpp +++ b/libcxx/test/std/utilities/template.bitset/includes.pass.cpp @@ -21,7 +21,6 @@ } { // test for test_typedef(); - test_typedef(); test_typedef(); test_typedef(); test_typedef(); diff --git a/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp b/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp --- a/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp +++ b/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp @@ -51,83 +51,85 @@ template constexpr void test() { - std::cmp_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_equal'}} - std::cmp_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_equal'}} - std::cmp_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_equal'}} - std::cmp_not_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_not_equal'}} - std::cmp_not_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_not_equal'}} - std::cmp_not_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_not_equal'}} - std::cmp_less(T(), T()); // expected-error11{{no matching function for call to 'cmp_less'}} - std::cmp_less(T(), int()); // expected-error11{{no matching function for call to 'cmp_less'}} - std::cmp_less(int(), T()); // expected-error11{{no matching function for call to 'cmp_less'}} - std::cmp_less_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_less_equal'}} - std::cmp_less_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_less_equal'}} - std::cmp_less_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_less_equal'}} - std::cmp_greater(T(), T()); // expected-error11{{no matching function for call to 'cmp_greater'}} - std::cmp_greater(T(), int()); // expected-error11{{no matching function for call to 'cmp_greater'}} - std::cmp_greater(int(), T()); // expected-error11{{no matching function for call to 'cmp_greater'}} - std::cmp_greater_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_greater_equal'}} - std::cmp_greater_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_greater_equal'}} - std::cmp_greater_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_greater_equal'}} - std::in_range(int()); // expected-error11{{no matching function for call to 'in_range'}} - std::in_range(T()); // expected-error11{{no matching function for call to 'in_range'}} + std::cmp_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}} + std::cmp_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}} + std::cmp_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}} + std::cmp_not_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_not_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_not_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_less(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less'}} + std::cmp_less(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_less'}} + std::cmp_less(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less'}} + std::cmp_less_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_less_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_less_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_greater(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater_equal'}} + std::cmp_greater_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_greater_equal'}} + std::cmp_greater_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater_equal'}} + std::in_range(int()); // expected-error 10-11 {{no matching function for call to 'in_range'}} + std::in_range(T()); // expected-error 10-11 {{no matching function for call to 'in_range'}} } #ifndef _LIBCPP_HAS_NO_CHAR8_T template constexpr void test_char8t() { - std::cmp_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_equal'}} - std::cmp_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_equal'}} - std::cmp_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_equal'}} - std::cmp_not_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_not_equal'}} - std::cmp_not_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_not_equal'}} - std::cmp_not_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_not_equal'}} - std::cmp_less(T(), T()); // expected-error1{{no matching function for call to 'cmp_less'}} - std::cmp_less(T(), int()); // expected-error1{{no matching function for call to 'cmp_less'}} - std::cmp_less(int(), T()); // expected-error1{{no matching function for call to 'cmp_less'}} - std::cmp_less_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_less_equal'}} - std::cmp_less_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_less_equal'}} - std::cmp_less_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_less_equal'}} - std::cmp_greater(T(), T()); // expected-error1{{no matching function for call to 'cmp_greater'}} - std::cmp_greater(T(), int()); // expected-error1{{no matching function for call to 'cmp_greater'}} - std::cmp_greater(int(), T()); // expected-error1{{no matching function for call to 'cmp_greater'}} - std::cmp_greater_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_greater_equal'}} - std::cmp_greater_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_greater_equal'}} - std::cmp_greater_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_greater_equal'}} - std::in_range(int()); // expected-error1{{no matching function for call to 'in_range'}} - std::in_range(T()); // expected-error1{{no matching function for call to 'in_range'}} + std::cmp_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_equal'}} + std::cmp_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_equal'}} + std::cmp_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_equal'}} + std::cmp_not_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_not_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_not_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_less(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_less'}} + std::cmp_less(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_less'}} + std::cmp_less(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_less'}} + std::cmp_less_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_less_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_less_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_greater(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater_equal'}} + std::cmp_greater_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_greater_equal'}} + std::cmp_greater_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater_equal'}} + std::in_range(int()); // expected-error 1 {{no matching function for call to 'in_range'}} + std::in_range(T()); // expected-error 1 {{no matching function for call to 'in_range'}} } #endif // _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS template constexpr void test_uchars() { - std::cmp_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_equal'}} - std::cmp_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_equal'}} - std::cmp_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_equal'}} - std::cmp_not_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_not_equal'}} - std::cmp_not_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_not_equal'}} - std::cmp_not_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_not_equal'}} - std::cmp_less(T(), T()); // expected-error2{{no matching function for call to 'cmp_less'}} - std::cmp_less(T(), int()); // expected-error2{{no matching function for call to 'cmp_less'}} - std::cmp_less(int(), T()); // expected-error2{{no matching function for call to 'cmp_less'}} - std::cmp_less_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_less_equal'}} - std::cmp_less_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_less_equal'}} - std::cmp_less_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_less_equal'}} - std::cmp_greater(T(), T()); // expected-error2{{no matching function for call to 'cmp_greater'}} - std::cmp_greater(T(), int()); // expected-error2{{no matching function for call to 'cmp_greater'}} - std::cmp_greater(int(), T()); // expected-error2{{no matching function for call to 'cmp_greater'}} - std::cmp_greater_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_greater_equal'}} - std::cmp_greater_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_greater_equal'}} - std::cmp_greater_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_greater_equal'}} - std::in_range(int()); // expected-error2{{no matching function for call to 'in_range'}} - std::in_range(T()); // expected-error2{{no matching function for call to 'in_range'}} + std::cmp_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_equal'}} + std::cmp_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_equal'}} + std::cmp_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_equal'}} + std::cmp_not_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_not_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_not_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_not_equal'}} + std::cmp_less(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_less'}} + std::cmp_less(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_less'}} + std::cmp_less(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_less'}} + std::cmp_less_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_less_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_less_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_less_equal'}} + std::cmp_greater(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater'}} + std::cmp_greater_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater_equal'}} + std::cmp_greater_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_greater_equal'}} + std::cmp_greater_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater_equal'}} + std::in_range(int()); // expected-error 2 {{no matching function for call to 'in_range'}} + std::in_range(T()); // expected-error 2 {{no matching function for call to 'in_range'}} } #endif // _LIBCPP_HAS_NO_UNICODE_CHARS int main() { test(); test(); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS test(); +#endif test(); test(); test(); diff --git a/libcxx/test/support/make_string.h b/libcxx/test/support/make_string.h --- a/libcxx/test/support/make_string.h +++ b/libcxx/test/support/make_string.h @@ -24,16 +24,24 @@ #define CHAR8_ONLY(x) #endif +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +# define IF_WIDE_CHARACTERS(...) __VA_ARGS__ +#else +# define IF_WIDE_CHARACTERS(...) /* nothing */ +#endif + #define MKSTR(Str) \ { \ - Str, TEST_CONCAT(L, Str), \ + Str, IF_WIDE_CHARACTERS(TEST_CONCAT(L, Str),) \ CHAR8_ONLY(TEST_CONCAT(u8, Str)) TEST_CONCAT(u, Str), \ TEST_CONCAT(U, Str) \ } struct MultiStringType { const char* s; +#ifndef TEST_HAS_NO_WIDE_CHARACTERS const wchar_t* w; +#endif #if TEST_STD_VER > 17 && defined(__cpp_char8_t) const char8_t* u8; #endif @@ -41,7 +49,9 @@ const char32_t* u32; constexpr operator const char*() const { return s; } +#ifndef TEST_HAS_NO_WIDE_CHARACTERS constexpr operator const wchar_t*() const { return w; } +#endif #if TEST_STD_VER > 17 && defined(__cpp_char8_t) constexpr operator const char8_t*() const { return u8; } #endif diff --git a/libcxx/test/support/poisoned_hash_helper.h b/libcxx/test/support/poisoned_hash_helper.h --- a/libcxx/test/support/poisoned_hash_helper.h +++ b/libcxx/test/support/poisoned_hash_helper.h @@ -57,7 +57,9 @@ char, signed char, unsigned char, +#ifndef TEST_HAS_NO_WIDE_CHARACTERS wchar_t, +#endif #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS char16_t, char32_t, diff --git a/libcxx/test/support/test.support/make_string_header.pass.cpp b/libcxx/test/support/test.support/make_string_header.pass.cpp --- a/libcxx/test/support/test.support/make_string_header.pass.cpp +++ b/libcxx/test/support/test.support/make_string_header.pass.cpp @@ -23,11 +23,13 @@ == " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS assert(MAKE_STRING(wchar_t, " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~") == L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"); +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T assert(MAKE_STRING(char8_t, " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -348,6 +348,11 @@ #define TEST_WIN_NO_FILESYSTEM_PERMS_NONE #endif +// Support for carving out parts of the test suite, like removing wide characters, etc. +#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# define TEST_HAS_NO_WIDE_CHARACTERS +#endif + #if defined(__GNUC__) #pragma GCC diagnostic pop #endif diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -465,6 +465,19 @@ limit: 2 timeout_in_minutes: 120 + - label: "No wide characters" + command: "libcxx/utils/ci/run-buildbot generic-no-wide-characters" + artifact_paths: + - "**/test-results.xml" + agents: + queue: "libcxx-builders" + os: "linux" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + # Other non-testing CI jobs - label: "Benchmarks" command: "libcxx/utils/ci/run-buildbot benchmarks" diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -364,6 +364,12 @@ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-runtimes ;; +generic-no-wide-characters) + clean + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \ + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" + check-runtimes +;; x86_64-apple-system) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ diff --git a/libcxx/utils/generate_header_tests.py b/libcxx/utils/generate_header_tests.py --- a/libcxx/utils/generate_header_tests.py +++ b/libcxx/utils/generate_header_tests.py @@ -50,6 +50,11 @@ "streambuf": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"], "strstream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"], + "wctype.h": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"], + "cwctype": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"], + "cwchar": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"], + "wchar.h": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"], + "experimental/coroutine": ["if defined(__cpp_coroutines)"], "experimental/regex": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"], } diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -100,6 +100,7 @@ '_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY': 'libcpp-has-no-filesystem-library', '_LIBCPP_HAS_NO_RANDOM_DEVICE': 'libcpp-has-no-random-device', '_LIBCPP_HAS_NO_LOCALIZATION': 'libcpp-has-no-localization', + '_LIBCPP_HAS_NO_WIDE_CHARACTERS': 'libcpp-has-no-wide-characters', '_LIBCPP_HAS_NO_INCOMPLETE_FORMAT': 'libcpp-has-no-incomplete-format', '_LIBCPP_HAS_NO_INCOMPLETE_RANGES': 'libcpp-has-no-incomplete-ranges', '_LIBCPP_HAS_NO_UNICODE': 'libcpp-has-no-unicode',