diff --git a/libcxx/.clang-format b/libcxx/.clang-format --- a/libcxx/.clang-format +++ b/libcxx/.clang-format @@ -4,10 +4,24 @@ Language: Cpp Standard: Cpp03 +# Lots of code uses indent of 4, but that's not consistent. +# AccessModifierOffset: -4 +# IndentWidth: 4 +AlignConsecutiveAssignments: true +AlignTrailingComments: true +# BreakBeforeBraces: Allman # Usage is not consistent. +# AlwaysBreakAfterReturnType: All # Do we want it only in templates? We could request and addition of AlwaysBreakBeforeReturnType as well. + AlwaysBreakTemplateDeclarations: true PointerAlignment: Left +IndentPPDirectives: AfterHash +# SpacesBeforeTrailingComments: 2 # Already inconsistent # Disable formatting options which may break tests. SortIncludes: false ReflowComments: false +# Alternative solution: we can have a different .clang-format in test/. E.g. with: +# CommentPragmas: '^ expected-' # Alternative to disabling ReflowComments. + +# Caveat currently released versions of clang-format mishandle concepts and consider boolean operators as rvalue references, hence using PointerAlignment. --- diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -108,7 +108,6 @@ }; #endif - class _LIBCPP_TYPE_VIS locale; template @@ -1074,10 +1073,10 @@ virtual int do_max_length() const _NOEXCEPT; }; -// template <> class codecvt +// template <> class codecvt // deprecated in C++20 template <> -class _LIBCPP_TYPE_VIS codecvt +class _LIBCPP_TYPE_VIS _LIBCPP_DEPRECATED_IN_CXX20 codecvt : public locale::facet, public codecvt_base { @@ -1160,10 +1159,100 @@ virtual int do_max_length() const _NOEXCEPT; }; -// template <> class codecvt +#ifndef _LIBCPP_NO_HAS_CHAR8_T + +// template <> class codecvt // C++20 + +template <> +class _LIBCPP_TYPE_VIS codecvt + : public locale::facet, + public codecvt_base +{ +public: + typedef char16_t intern_type; + typedef char8_t extern_type; + typedef mbstate_t state_type; + + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(size_t __refs = 0) + : locale::facet(__refs) {} + + _LIBCPP_INLINE_VISIBILITY + result out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_unshift(__st, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const + { + return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + int encoding() const _NOEXCEPT + { + return do_encoding(); + } + + _LIBCPP_INLINE_VISIBILITY + bool always_noconv() const _NOEXCEPT + { + return do_always_noconv(); + } + + _LIBCPP_INLINE_VISIBILITY + int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const + { + return do_length(__st, __frm, __end, __mx); + } + + _LIBCPP_INLINE_VISIBILITY + int max_length() const _NOEXCEPT + { + return do_max_length(); + } + + static locale::id id; + +protected: + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(const char*, size_t __refs = 0) + : locale::facet(__refs) {} + + ~codecvt(); + + virtual result do_out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual result do_in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const; + virtual result do_unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; + 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 + +// template <> class codecvt // deprecated in C++20 template <> -class _LIBCPP_TYPE_VIS codecvt +class _LIBCPP_TYPE_VIS _LIBCPP_DEPRECATED_IN_CXX20 codecvt : public locale::facet, public codecvt_base { @@ -1246,6 +1335,96 @@ virtual int do_max_length() const _NOEXCEPT; }; +#ifndef _LIBCPP_NO_HAS_CHAR8_T + +// template <> class codecvt // C++20 + +template <> +class _LIBCPP_TYPE_VIS codecvt + : public locale::facet, + public codecvt_base +{ +public: + typedef char32_t intern_type; + typedef char8_t extern_type; + typedef mbstate_t state_type; + + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(size_t __refs = 0) + : locale::facet(__refs) {} + + _LIBCPP_INLINE_VISIBILITY + result out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_unshift(__st, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const + { + return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + int encoding() const _NOEXCEPT + { + return do_encoding(); + } + + _LIBCPP_INLINE_VISIBILITY + bool always_noconv() const _NOEXCEPT + { + return do_always_noconv(); + } + + _LIBCPP_INLINE_VISIBILITY + int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const + { + return do_length(__st, __frm, __end, __mx); + } + + _LIBCPP_INLINE_VISIBILITY + int max_length() const _NOEXCEPT + { + return do_max_length(); + } + + static locale::id id; + +protected: + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(const char*, size_t __refs = 0) + : locale::facet(__refs) {} + + ~codecvt(); + + virtual result do_out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual result do_in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const; + virtual result do_unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; + 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 + // template class codecvt_byname template @@ -1263,15 +1442,21 @@ ~codecvt_byname(); }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname() { } +_LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DEPRECATED_IN_CXX20 codecvt_byname) // deprecated in C++20 +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DEPRECATED_IN_CXX20 codecvt_byname) // deprecated in C++20 +#ifndef _LIBCPP_NO_HAS_CHAR8_T +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) // C++20 +_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) // C++20 +#endif template struct __narrow_to_utf8 @@ -1295,12 +1480,14 @@ } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16> : public codecvt { _LIBCPP_INLINE_VISIBILITY __narrow_to_utf8() : codecvt(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8(); @@ -1329,12 +1516,14 @@ } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<32> : public codecvt { _LIBCPP_INLINE_VISIBILITY __narrow_to_utf8() : codecvt(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8(); @@ -1385,12 +1574,14 @@ } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16> : public codecvt { _LIBCPP_INLINE_VISIBILITY __widen_from_utf8() : codecvt(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8(); @@ -1419,12 +1610,14 @@ } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32> : public codecvt { _LIBCPP_INLINE_VISIBILITY __widen_from_utf8() : codecvt(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8(); diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt --- a/libcxx/include/codecvt +++ b/libcxx/include/codecvt @@ -109,6 +109,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf8 : public codecvt @@ -125,6 +126,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, @@ -144,6 +147,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf8 : public codecvt @@ -160,6 +164,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, @@ -267,6 +273,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt @@ -283,6 +290,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, @@ -302,6 +311,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt @@ -318,6 +328,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, @@ -337,6 +349,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt @@ -353,6 +366,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, @@ -372,6 +387,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf16 : public codecvt @@ -388,6 +404,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, @@ -460,6 +478,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16 : public codecvt @@ -476,6 +495,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, @@ -495,6 +516,7 @@ virtual int do_max_length() const _NOEXCEPT; }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16 : public codecvt @@ -511,6 +533,8 @@ codecvt_mode _Mode) : codecvt(__refs), _Maxcode_(_Maxcode), _Mode_(_Mode) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP + protected: virtual result do_out(state_type& __st, diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -1663,8 +1663,8 @@ using argument_type = monostate; using result_type = size_t; - inline _LIBCPP_INLINE_VISIBILITY - result_type operator()(const argument_type&) const _NOEXCEPT { + inline _LIBCPP_INLINE_VISIBILITY result_type + operator()(const argument_type&) const _NOEXCEPT { return 66740831; // return a fundamentally attractive random value. } }; diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -3403,7 +3403,7 @@ erase_if(vector<_Tp, _Allocator>& __c, _Predicate __pred) { auto __old_size = __c.size(); __c.erase(_VSTD::remove_if(__c.begin(), __c.end(), __pred), __c.end()); - return __old_size - __c.size(); + return __old_size - __c.size(); } #endif diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -158,7 +158,7 @@ class _LIBCPP_HIDDEN locale::__imp : public facet { - enum {N = 28}; + enum {N = 30}; #if defined(_LIBCPP_COMPILER_MSVC) // FIXME: MSVC doesn't support aligned parameters by value. // I can't get the __sso_allocator to work here @@ -202,8 +202,14 @@ install(&make<_VSTD::ctype >(1u)); install(&make >(1u)); install(&make >(1u)); +_LIBCPP_SUPPRESS_DEPRECATED_PUSH install(&make >(1u)); install(&make >(1u)); +_LIBCPP_SUPPRESS_DEPRECATED_POP +#ifndef _LIBCPP_NO_HAS_CHAR8_T + install(&make >(1u)); + install(&make >(1u)); +#endif install(&make >(1u)); install(&make >(1u)); install(&make >(1u)); @@ -245,8 +251,14 @@ install(new ctype_byname(name_)); install(new codecvt_byname(name_)); install(new codecvt_byname(name_)); +_LIBCPP_SUPPRESS_DEPRECATED_PUSH install(new codecvt_byname(name_)); install(new codecvt_byname(name_)); +_LIBCPP_SUPPRESS_DEPRECATED_POP +#ifndef _LIBCPP_NO_HAS_CHAR8_T + install(new codecvt_byname(name_)); + install(new codecvt_byname(name_)); +#endif install(new numpunct_byname(name_)); install(new numpunct_byname(name_)); install(new moneypunct_byname(name_)); @@ -315,8 +327,14 @@ install(new ctype_byname(name)); install(new codecvt_byname(name)); install(new codecvt_byname(name)); +_LIBCPP_SUPPRESS_DEPRECATED_PUSH install(new codecvt_byname(name)); install(new codecvt_byname(name)); +_LIBCPP_SUPPRESS_DEPRECATED_POP +#ifndef _LIBCPP_NO_HAS_CHAR8_T + install(new codecvt_byname(name)); + install(new codecvt_byname(name)); +#endif } if (c & locale::monetary) { @@ -385,8 +403,14 @@ install_from<_VSTD::ctype >(one); install_from<_VSTD::ctype >(one); install_from<_VSTD::codecvt >(one); +_LIBCPP_SUPPRESS_DEPRECATED_PUSH install_from<_VSTD::codecvt >(one); install_from<_VSTD::codecvt >(one); +_LIBCPP_SUPPRESS_DEPRECATED_POP +#ifndef _LIBCPP_NO_HAS_CHAR8_T + install_from<_VSTD::codecvt >(one); + install_from<_VSTD::codecvt >(one); +#endif install_from<_VSTD::codecvt >(one); } if (c & locale::monetary) @@ -3171,6 +3195,87 @@ return 4; } +#ifndef _LIBCPP_NO_HAS_CHAR8_T + +// template <> class codecvt + +locale::id codecvt::id; + +codecvt::~codecvt() +{ +} + +codecvt::result +codecvt::do_out(state_type&, + const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, + extern_type* to, extern_type* to_end, extern_type*& to_nxt) const +{ + const uint16_t* _frm = reinterpret_cast(frm); + const uint16_t* _frm_end = reinterpret_cast(frm_end); + const uint16_t* _frm_nxt = _frm; + uint8_t* _to = reinterpret_cast(to); + uint8_t* _to_end = reinterpret_cast(to_end); + uint8_t* _to_nxt = _to; + result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt); + frm_nxt = frm + (_frm_nxt - _frm); + to_nxt = to + (_to_nxt - _to); + return r; +} + +codecvt::result +codecvt::do_in(state_type&, + const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt, + intern_type* to, intern_type* to_end, intern_type*& to_nxt) const +{ + const uint8_t* _frm = reinterpret_cast(frm); + const uint8_t* _frm_end = reinterpret_cast(frm_end); + const uint8_t* _frm_nxt = _frm; + uint16_t* _to = reinterpret_cast(to); + uint16_t* _to_end = reinterpret_cast(to_end); + uint16_t* _to_nxt = _to; + result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt); + frm_nxt = frm + (_frm_nxt - _frm); + to_nxt = to + (_to_nxt - _to); + return r; +} + +codecvt::result +codecvt::do_unshift(state_type&, + extern_type* to, extern_type*, extern_type*& to_nxt) const +{ + to_nxt = to; + return noconv; +} + +int +codecvt::do_encoding() const _NOEXCEPT +{ + return 0; +} + +bool +codecvt::do_always_noconv() const _NOEXCEPT +{ + return false; +} + +int +codecvt::do_length(state_type&, + const extern_type* frm, const extern_type* frm_end, size_t mx) const +{ + const uint8_t* _frm = reinterpret_cast(frm); + const uint8_t* _frm_end = reinterpret_cast(frm_end); + return utf8_to_utf16_length(_frm, _frm_end, mx); +} + +int +codecvt::do_max_length() const _NOEXCEPT +{ + return 4; +} + +#endif + // template <> class codecvt locale::id codecvt::id; @@ -3248,6 +3353,87 @@ return 4; } +#ifndef _LIBCPP_NO_HAS_CHAR8_T + +// template <> class codecvt + +locale::id codecvt::id; + +codecvt::~codecvt() +{ +} + +codecvt::result +codecvt::do_out(state_type&, + const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, + extern_type* to, extern_type* to_end, extern_type*& to_nxt) const +{ + const uint32_t* _frm = reinterpret_cast(frm); + const uint32_t* _frm_end = reinterpret_cast(frm_end); + const uint32_t* _frm_nxt = _frm; + uint8_t* _to = reinterpret_cast(to); + uint8_t* _to_end = reinterpret_cast(to_end); + uint8_t* _to_nxt = _to; + result r = ucs4_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt); + frm_nxt = frm + (_frm_nxt - _frm); + to_nxt = to + (_to_nxt - _to); + return r; +} + +codecvt::result +codecvt::do_in(state_type&, + const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt, + intern_type* to, intern_type* to_end, intern_type*& to_nxt) const +{ + const uint8_t* _frm = reinterpret_cast(frm); + const uint8_t* _frm_end = reinterpret_cast(frm_end); + const uint8_t* _frm_nxt = _frm; + uint32_t* _to = reinterpret_cast(to); + uint32_t* _to_end = reinterpret_cast(to_end); + uint32_t* _to_nxt = _to; + result r = utf8_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt); + frm_nxt = frm + (_frm_nxt - _frm); + to_nxt = to + (_to_nxt - _to); + return r; +} + +codecvt::result +codecvt::do_unshift(state_type&, + extern_type* to, extern_type*, extern_type*& to_nxt) const +{ + to_nxt = to; + return noconv; +} + +int +codecvt::do_encoding() const _NOEXCEPT +{ + return 0; +} + +bool +codecvt::do_always_noconv() const _NOEXCEPT +{ + return false; +} + +int +codecvt::do_length(state_type&, + const extern_type* frm, const extern_type* frm_end, size_t mx) const +{ + const uint8_t* _frm = reinterpret_cast(frm); + const uint8_t* _frm_end = reinterpret_cast(frm_end); + return utf8_to_ucs4_length(_frm, _frm_end, mx); +} + +int +codecvt::do_max_length() const _NOEXCEPT +{ + return 4; +} + +#endif + // __codecvt_utf8 __codecvt_utf8::result @@ -6148,7 +6334,11 @@ 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; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DEPRECATED_IN_CXX20 codecvt_byname; +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DEPRECATED_IN_CXX20 codecvt_byname; +#ifndef _LIBCPP_NO_HAS_CHAR8_T +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; +template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; +#endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp b/libcxx/test/libcxx/localization/locales/locale/locale.types/locale.facet/no_allocation.pass.cpp copy from libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp copy to libcxx/test/libcxx/localization/locales/locale/locale.types/locale.facet/no_allocation.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp +++ b/libcxx/test/libcxx/localization/locales/locale/locale.types/locale.facet/no_allocation.pass.cpp @@ -8,22 +8,16 @@ // -// template <> class codecvt +// This test verifies that the construction of locale::__imp does not allocate +// for facets, as it uses __sso_allocator. It would fail if new +// facets have been added (using install()) but N hasn't been adjusted to +// account for them. -// bool always_noconv() const throw(); - -#include #include -#include "test_macros.h" - -typedef std::codecvt F; - -int main(int, char**) -{ - std::locale l = std::locale::classic(); - const F& f = std::use_facet(l); - assert(!f.always_noconv()); +#include "count_new.h" +int main(int, char**) { + assert(globalMemCounter.checkOutstandingNewEq(0)); return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp copy from libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp copy to libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp @@ -8,22 +8,20 @@ // -// template <> class codecvt +// codecvt_byname +// deprecated in C++20 -// bool always_noconv() const throw(); +// UNSUPPORTED: c++03, c++11, c++14, c++17 #include -#include +#include "../with_public_dtor.hpp" #include "test_macros.h" -typedef std::codecvt F; - -int main(int, char**) +int main(int, char **) { - std::locale l = std::locale::classic(); - const F& f = std::use_facet(l); - assert(!f.always_noconv()); + with_public_dtor> cvt("", 0); // expected-warning {{'codecvt_byname' is deprecated}} + (void)cvt; - return 0; + return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp copy from libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp copy to libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp @@ -8,22 +8,20 @@ // -// template <> class codecvt +// codecvt_byname +// deprecated in C++20 -// bool always_noconv() const throw(); +// UNSUPPORTED: c++03, c++11, c++14, c++17 #include -#include +#include "../with_public_dtor.hpp" #include "test_macros.h" -typedef std::codecvt F; - -int main(int, char**) +int main(int, char **) { - std::locale l = std::locale::classic(); - const F& f = std::use_facet(l); - assert(!f.always_noconv()); + with_public_dtor> cvt("", 0); // expected-warning {{'codecvt_byname' is deprecated}} + (void)cvt; - return 0; + return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp @@ -13,6 +13,9 @@ // explicit codecvt_byname(const char* nm, size_t refs = 0); // explicit codecvt_byname(const string& nm, size_t refs = 0); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t_char8_t.pass.cpp copy from libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp copy to libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t_char8_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t_char8_t.pass.cpp @@ -6,9 +6,22 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // -// template <> class codecvt_byname +// template <> class codecvt_byname // explicit codecvt_byname(const char* nm, size_t refs = 0); // explicit codecvt_byname(const string& nm, size_t refs = 0); @@ -18,7 +31,7 @@ #include "test_macros.h" -typedef std::codecvt_byname F; +typedef std::codecvt_byname F; class my_facet : public F diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp @@ -13,6 +13,9 @@ // explicit codecvt_byname(const char* nm, size_t refs = 0); // explicit codecvt_byname(const string& nm, size_t refs = 0); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t_char8_t.pass.cpp copy from libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp copy to libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t_char8_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t_char8_t.pass.cpp @@ -6,9 +6,22 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // -// template <> class codecvt_byname +// template <> class codecvt_byname // explicit codecvt_byname(const char* nm, size_t refs = 0); // explicit codecvt_byname(const string& nm, size_t refs = 0); @@ -18,7 +31,7 @@ #include "test_macros.h" -typedef std::codecvt_byname F; +typedef std::codecvt_byname F; class my_facet : public F diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp copy from libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp copy to libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp @@ -8,22 +8,20 @@ // -// template <> class codecvt +// codecvt +// deprecated in C++20 -// bool always_noconv() const throw(); +// UNSUPPORTED: c++03, c++11, c++14, c++17 #include -#include +#include "../with_public_dtor.hpp" #include "test_macros.h" -typedef std::codecvt F; - -int main(int, char**) +int main(int, char **) { - std::locale l = std::locale::classic(); - const F& f = std::use_facet(l); - assert(!f.always_noconv()); + with_public_dtor> cvt("", 0); // expected-warning {{'codecvt' is deprecated}} + (void)cvt; - return 0; + return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp copy from libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp copy to libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp @@ -8,22 +8,20 @@ // -// template <> class codecvt +// codecvt +// deprecated in C++20 -// bool always_noconv() const throw(); +// UNSUPPORTED: c++03, c++11, c++14, c++17 #include -#include +#include "../with_public_dtor.hpp" #include "test_macros.h" -typedef std::codecvt F; - -int main(int, char**) +int main(int, char **) { - std::locale l = std::locale::classic(); - const F& f = std::use_facet(l); - assert(!f.always_noconv()); + with_public_dtor> cvt("", 0); // expected-warning {{'codecvt' is deprecated}} + (void)cvt; - return 0; + return 0; } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp @@ -12,6 +12,9 @@ // explicit codecvt(size_t refs = 0); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t_char8_t.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // explicit codecvt(size_t refs = 0); -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp @@ -12,6 +12,9 @@ // explicit codecvt(size_t refs = 0); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t_char8_t.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // explicit codecvt(size_t refs = 0); -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp @@ -12,6 +12,9 @@ // bool always_noconv() const throw(); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_always_noconv.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // bool always_noconv() const noexcept; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_encoding.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // int encoding() const noexcept; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt @@ -14,11 +27,6 @@ // const externT* from, const externT* from_end, const externT*& from_next, // internT* to, internT* to_end, internT*& to_next) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_length.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // int length(stateT& state, const externT* from, const externT* from_end, size_t max) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_max_length.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // int max_length() const noexcept; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt @@ -14,11 +27,6 @@ // const internT* from, const internT* from_end, const internT*& from_next, // externT* to, externT* to_end, externT*& to_next) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_unshift.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt @@ -13,11 +26,6 @@ // result unshift(stateT& state, // externT* to, externT* to_end, externT*& to_next) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp @@ -12,6 +12,9 @@ // int encoding() const throw(); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp @@ -14,6 +14,9 @@ // const externT* from, const externT* from_end, const externT*& from_next, // internT* to, internT* to_end, internT*& to_next) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp @@ -12,6 +12,9 @@ // int length(stateT& state, const externT* from, const externT* from_end, size_t max) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp @@ -12,6 +12,9 @@ // int max_length() const throw(); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp @@ -14,6 +14,9 @@ // const internT* from, const internT* from_end, const internT*& from_next, // externT* to, externT* to_end, externT*& to_next) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp @@ -13,6 +13,9 @@ // result unshift(stateT& state, // externT* to, externT* to_end, externT*& to_next) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp @@ -12,6 +12,9 @@ // bool always_noconv() const throw(); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_always_noconv.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // bool always_noconv() const noexcept; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_encoding.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // int encoding() const noexcept; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt @@ -14,11 +27,6 @@ // const externT* from, const externT* from_end, const externT*& from_next, // internT* to, internT* to_end, internT*& to_next) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_length.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // int length(stateT& state, const externT* from, const externT* from_end, size_t max) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_max_length.pass.cpp @@ -6,17 +6,25 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt // int max_length() const noexcept; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt @@ -14,11 +27,6 @@ // const internT* from, const internT* from_end, const internT*& from_next, // externT* to, externT* to_end, externT*& to_next) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_unshift.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> class codecvt @@ -13,11 +26,6 @@ // result unshift(stateT& state, // externT* to, externT* to_end, externT*& to_next) const; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp @@ -12,6 +12,9 @@ // int encoding() const throw(); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp @@ -14,6 +14,9 @@ // const externT* from, const externT* from_end, const externT*& from_next, // internT* to, internT* to_end, internT*& to_next) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp @@ -12,6 +12,9 @@ // int length(stateT& state, const externT* from, const externT* from_end, size_t max) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp @@ -12,6 +12,9 @@ // int max_length() const throw(); +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp @@ -14,6 +14,9 @@ // const internT* from, const internT* from_end, const internT*& from_next, // externT* to, externT* to_end, externT*& to_next) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp @@ -13,6 +13,9 @@ // result unshift(stateT& state, // externT* to, externT* to_end, externT*& to_next) const; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp @@ -6,6 +6,20 @@ // //===----------------------------------------------------------------------===// +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // template <> class codecvt @@ -47,8 +61,7 @@ char* c16cp; F32_8::extern_type c8[4]; -// C++20 codecvt specializations for char8_t are not yet implemented -#if TEST_STD_VER > 17 && !defined(_LIBCPP_VERSION) +#if TEST_STD_VER > 17 typedef std::codecvt F32_8T; typedef std::codecvt F16_8T; const F32_8T& f32_8t = std::use_facet(std::locale::classic()); @@ -69,8 +82,7 @@ F32_8::error); #endif -// C++20 codecvt specializations for char8_t are not yet implemented -#if TEST_STD_VER > 17 && !defined(_LIBCPP_VERSION) +#if TEST_STD_VER > 17 assert(f32_8t.out(mbs32_8t, &c32x, &c32x + 1, c_c32p, c8t, c8t + 4, c8tp) == F32_8T::error); #endif @@ -153,8 +165,7 @@ assert(c32p - &c32 == 1); assert(c32 == c32x); -// C++20 codecvt specializations for char8_t are not yet implemented -#if TEST_STD_VER > 17 && !defined(_LIBCPP_VERSION) +#if TEST_STD_VER > 17 assert(f32_8t.out(mbs32_8t, &c32x, &c32x + 1, c_c32p, c8t, c8t + 4, c8tp) == F32_8T::ok); assert(c_c32p - &c32x == 1); diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp @@ -20,6 +20,9 @@ // ... // }; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t_char8_t.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> @@ -20,11 +33,6 @@ // ... // }; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp @@ -20,6 +20,9 @@ // ... // }; +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t_char8_t.pass.cpp @@ -6,6 +6,19 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + // // template <> @@ -20,11 +33,6 @@ // ... // }; -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// C++20 codecvt specializations for char8_t are not yet implemented: -// UNSUPPORTED: libc++ - #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/with_public_dtor.hpp b/libcxx/test/std/localization/locale.categories/category.ctype/with_public_dtor.hpp new file mode 100644 --- /dev/null +++ b/libcxx/test/std/localization/locale.categories/category.ctype/with_public_dtor.hpp @@ -0,0 +1,19 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#include + +template +struct with_public_dtor : T +{ + template + explicit with_public_dtor(Args &&... args) + : T(std::forward(args)...) + { + } +}; 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 @@ -8,6 +8,20 @@ // REQUIRES: locale.ru_RU.UTF-8 +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // const locale& operator=(const locale& other) throw(); @@ -32,6 +46,10 @@ 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))); 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 @@ -12,6 +12,20 @@ // REQUIRES: locale.ru_RU.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // explicit locale(const char* std_name); @@ -36,6 +50,10 @@ 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))); 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 @@ -8,6 +8,20 @@ // REQUIRES: locale.fr_FR.UTF-8 +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // locale(const locale& other) throw(); @@ -30,6 +44,10 @@ 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))); 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 @@ -8,6 +8,20 @@ // REQUIRES: locale.en_US.UTF-8 +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // locale() throw(); @@ -29,6 +43,10 @@ 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))); 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 @@ -10,6 +10,20 @@ // REQUIRES: locale.ru_RU.UTF-8 // UNSUPPORTED: sanitizer-new-delete +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // locale(const locale& other, const char* std_name, category); @@ -32,6 +46,10 @@ 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))); 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 @@ -8,6 +8,20 @@ // REQUIRES: locale.ru_RU.UTF-8 +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // template locale(const locale& other, Facet* f); @@ -31,6 +45,10 @@ 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))); 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 @@ -10,6 +10,20 @@ // REQUIRES: locale.ru_RU.UTF-8 // UNSUPPORTED: sanitizer-new-delete +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // locale(const locale& other, const locale& one, category cats); @@ -32,6 +46,10 @@ 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))); 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 @@ -10,6 +10,20 @@ // REQUIRES: locale.ru_RU.UTF-8 // UNSUPPORTED: sanitizer-new-delete +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // locale(const locale& other, const string& std_name, category cat); @@ -33,6 +47,10 @@ 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))); 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 @@ -9,6 +9,20 @@ // REQUIRES: locale.ru_RU.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // explicit locale(const string& std_name); @@ -31,6 +45,10 @@ 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))); 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 @@ -6,6 +6,20 @@ // //===----------------------------------------------------------------------===// +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // template locale combine(const locale& other) const; @@ -28,6 +42,10 @@ 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))); 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 @@ -6,6 +6,20 @@ // //===----------------------------------------------------------------------===// +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // static const locale& classic(); @@ -25,6 +39,10 @@ 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))); 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 @@ -8,6 +8,20 @@ // REQUIRES: locale.en_US.UTF-8 +// This test relies on P0482 being fixed, which isn't in +// older Apple dylibs +// +// XFAIL: with_system_cxx_lib=macosx10.15 +// XFAIL: with_system_cxx_lib=macosx10.14 +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 + +// This test runs in C++20, but we have deprecated codecvt in C++20. +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS + // // static const locale& classic(); @@ -28,6 +42,10 @@ 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))); 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 @@ -15,6 +15,17 @@ # steps: + - label: "Format" + command: "libcxx/utils/ci/run-buildbot check-format" + artifact_paths: + - "**/*.patch" + agents: + queue: "libcxx-builders" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + - label: "C++03" command: "libcxx/utils/ci/run-buildbot generic-cxx03" artifact_paths: 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 @@ -94,6 +94,14 @@ } case "${BUILDER}" in +check-format) + clean + echo "+++ Checking formatting" + # We need to set --extensions so that clang-format checks extensionless files. + git-clang-format --diff --extensions ',h,hh,hpp,hxx,c,cc,cxx,cpp' HEAD~1 -- libcxx/ > ${BUILD_DIR}/clang-format.patch + # Check if the diff is empty, fail otherwise. + ! grep -q -n '^--- a' ${BUILD_DIR}/clang-format.patch +;; generic-cxx03) export CC=clang export CXX=clang++ diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -561,14 +561,14 @@ for tc in feature_test_macros: if std not in tc["values"]: continue - inner_indent = 1 + inner_indent = 2 if 'depends' in tc.keys(): assert 'internal_depends' in tc.keys() - result += "# if %s\n" % tc["internal_depends"] + result += "# if %s\n" % tc["internal_depends"] inner_indent += 2 if get_value_before(tc["values"], std) is not None: assert 'depends' not in tc.keys() - result += "# undef %s\n" % tc["name"] + result += "# undef %s\n" % tc["name"] line = "#%sdefine %s" % ((" " * inner_indent), tc["name"]) line += " " * (indent - len(line)) line += "%sL" % tc["values"][std] @@ -577,7 +577,7 @@ result += line result += "\n" if 'depends' in tc.keys(): - result += "# endif\n" + result += "# endif\n" return result def chunks(l, n): @@ -642,9 +642,11 @@ #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header +# pragma GCC system_header #endif +// clang-format off + #if _LIBCPP_STD_VER > 11 {cxx14_macros} #endif @@ -657,6 +659,8 @@ {cxx2a_macros} #endif +// clang-format on + #endif // _LIBCPP_VERSIONH """ @@ -677,48 +681,48 @@ test_types = { "undefined": """ -# ifdef {name} -# error "{name} should not be defined before {std_first}" -# endif +# ifdef {name} +# error "{name} should not be defined before {std_first}" +# endif """, "depends": """ -# if {depends} -# ifndef {name} -# error "{name} should be defined in {std}" -# endif -# if {name} != {value} -# error "{name} should have the value {value} in {std}" -# endif -# else -# ifdef {name} -# error "{name} should not be defined when {depends} is not defined!" -# endif -# endif +# if {depends} +# ifndef {name} +# error "{name} should be defined in {std}" +# endif +# if {name} != {value} +# error "{name} should have the value {value} in {std}" +# endif +# else +# ifdef {name} +# error "{name} should not be defined when {depends} is not defined!" +# endif +# endif """, "unimplemented": """ -# if !defined(_LIBCPP_VERSION) -# ifndef {name} -# error "{name} should be defined in {std}" -# endif -# if {name} != {value} -# error "{name} should have the value {value} in {std}" -# endif -# else // _LIBCPP_VERSION -# ifdef {name} -# error "{name} should not be defined because it is unimplemented in libc++!" -# endif -# endif +# if !defined(_LIBCPP_VERSION) +# ifndef {name} +# error "{name} should be defined in {std}" +# endif +# if {name} != {value} +# error "{name} should have the value {value} in {std}" +# endif +# else // _LIBCPP_VERSION +# ifdef {name} +# error "{name} should not be defined because it is unimplemented in libc++!" +# endif +# endif """, "defined":""" -# ifndef {name} -# error "{name} should be defined in {std}" -# endif -# if {name} != {value} -# error "{name} should have the value {value} in {std}" -# endif +# ifndef {name} +# error "{name} should be defined in {std}" +# endif +# if {name} != {value} +# error "{name} should have the value {value} in {std}" +# endif """ } @@ -784,6 +788,8 @@ #include <{header}> #include "test_macros.h" +// clang-format off + #if TEST_STD_VER < 14 {cxx11_tests} @@ -802,6 +808,8 @@ #endif // TEST_STD_VER > 17 +// clang-format on + int main(int, char**) {{ return 0; }} """.format(script_name=script_name, header=h,