Index: vendor/libc++/dist/include/__bsd_locale_defaults.h =================================================================== --- vendor/libc++/dist/include/__bsd_locale_defaults.h (revision 322263) +++ vendor/libc++/dist/include/__bsd_locale_defaults.h (revision 322264) @@ -1,33 +1,37 @@ // -*- C++ -*- //===---------------------- __bsd_locale_defaults.h -----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // The BSDs have lots of *_l functions. We don't want to define those symbols // on other platforms though, for fear of conflicts with user code. So here, // we will define the mapping from an internal macro to the real BSD symbol. //===----------------------------------------------------------------------===// #ifndef _LIBCPP_BSD_LOCALE_DEFAULTS_H #define _LIBCPP_BSD_LOCALE_DEFAULTS_H +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + #define __libcpp_mb_cur_max_l(loc) MB_CUR_MAX_L(loc) #define __libcpp_btowc_l(ch, loc) btowc_l(ch, loc) #define __libcpp_wctob_l(wch, loc) wctob_l(wch, loc) #define __libcpp_wcsnrtombs_l(dst, src, nwc, len, ps, loc) wcsnrtombs_l(dst, src, nwc, len, ps, loc) #define __libcpp_wcrtomb_l(src, wc, ps, loc) wcrtomb_l(src, wc, ps, loc) #define __libcpp_mbsnrtowcs_l(dst, src, nms, len, ps, loc) mbsnrtowcs_l(dst, src, nms, len, ps, loc) #define __libcpp_mbrtowc_l(pwc, s, n, ps, l) mbrtowc_l(pwc, s, n, ps, l) #define __libcpp_mbtowc_l(pwc, pmb, max, l) mbtowc_l(pwc, pmb, max, l) #define __libcpp_mbrlen_l(s, n, ps, l) mbrlen_l(s, n, ps, l) #define __libcpp_localeconv_l(l) localeconv_l(l) #define __libcpp_mbsrtowcs_l(dest, src, len, ps, l) mbsrtowcs_l(dest, src, len, ps, l) #define __libcpp_snprintf_l(...) snprintf_l(__VA_ARGS__) #define __libcpp_asprintf_l(...) asprintf_l(__VA_ARGS__) #define __libcpp_sscanf_l(...) sscanf_l(__VA_ARGS__) #endif // _LIBCPP_BSD_LOCALE_DEFAULTS_H Index: vendor/libc++/dist/include/__bsd_locale_fallbacks.h =================================================================== --- vendor/libc++/dist/include/__bsd_locale_fallbacks.h (revision 322263) +++ vendor/libc++/dist/include/__bsd_locale_fallbacks.h (revision 322264) @@ -1,136 +1,140 @@ // -*- C++ -*- //===---------------------- __bsd_locale_fallbacks.h ----------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // The BSDs have lots of *_l functions. This file provides reimplementations // of those functions for non-BSD platforms. //===----------------------------------------------------------------------===// #ifndef _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H #define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H #include #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + _LIBCPP_BEGIN_NAMESPACE_STD inline _LIBCPP_ALWAYS_INLINE decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l) { __libcpp_locale_guard __current(__l); return MB_CUR_MAX; } inline _LIBCPP_ALWAYS_INLINE wint_t __libcpp_btowc_l(int __c, locale_t __l) { __libcpp_locale_guard __current(__l); return btowc(__c); } inline _LIBCPP_ALWAYS_INLINE int __libcpp_wctob_l(wint_t __c, locale_t __l) { __libcpp_locale_guard __current(__l); return wctob(__c); } inline _LIBCPP_ALWAYS_INLINE size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc, size_t __len, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return wcsnrtombs(__dest, __src, __nwc, __len, __ps); } inline _LIBCPP_ALWAYS_INLINE size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return wcrtomb(__s, __wc, __ps); } inline _LIBCPP_ALWAYS_INLINE size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms, size_t __len, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbsnrtowcs(__dest, __src, __nms, __len, __ps); } inline _LIBCPP_ALWAYS_INLINE size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbrtowc(__pwc, __s, __n, __ps); } inline _LIBCPP_ALWAYS_INLINE int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l) { __libcpp_locale_guard __current(__l); return mbtowc(__pwc, __pmb, __max); } inline _LIBCPP_ALWAYS_INLINE size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbrlen(__s, __n, __ps); } inline _LIBCPP_ALWAYS_INLINE lconv *__libcpp_localeconv_l(locale_t __l) { __libcpp_locale_guard __current(__l); return localeconv(); } inline _LIBCPP_ALWAYS_INLINE size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbsrtowcs(__dest, __src, __len, __ps); } inline int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); __libcpp_locale_guard __current(__l); int __res = vsnprintf(__s, __n, __format, __va); va_end(__va); return __res; } inline int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); __libcpp_locale_guard __current(__l); int __res = vasprintf(__s, __format, __va); va_end(__va); return __res; } inline int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); __libcpp_locale_guard __current(__l); int __res = vsscanf(__s, __format, __va); va_end(__va); return __res; } _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H Index: vendor/libc++/dist/include/__locale =================================================================== --- vendor/libc++/dist/include/__locale (revision 322263) +++ vendor/libc++/dist/include/__locale (revision 322264) @@ -1,1501 +1,1501 @@ // -*- C++ -*- //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___LOCALE #define _LIBCPP___LOCALE #include <__config> #include #include #include #include #include #include #include #if defined(_LIBCPP_MSVCRT_LIKE) # include #elif defined(_AIX) # include #elif defined(__ANDROID__) // Android gained the locale aware functions in L (API level 21) # include # if __ANDROID_API__ <= 20 # include # endif #elif defined(__sun__) # include # include #elif defined(_NEWLIB_VERSION) # include -#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ +#elif (defined(__APPLE__) || defined(__FreeBSD__) \ || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) # include #elif defined(__Fuchsia__) # include #elif defined(_LIBCPP_HAS_MUSL_LIBC) # include #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD #if !defined(_LIBCPP_LOCALE__L_EXTENSIONS) || defined(_LIBCPP_MSVCRT) struct __libcpp_locale_guard { _LIBCPP_INLINE_VISIBILITY __libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {} _LIBCPP_INLINE_VISIBILITY ~__libcpp_locale_guard() { if (__old_loc_) uselocale(__old_loc_); } locale_t __old_loc_; private: __libcpp_locale_guard(__libcpp_locale_guard const&); __libcpp_locale_guard& operator=(__libcpp_locale_guard const&); }; #endif class _LIBCPP_TYPE_VIS locale; template _LIBCPP_INLINE_VISIBILITY bool has_facet(const locale&) _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY const _Facet& use_facet(const locale&); class _LIBCPP_TYPE_VIS locale { public: // types: class _LIBCPP_TYPE_VIS facet; class _LIBCPP_TYPE_VIS id; typedef int category; _LIBCPP_AVAILABILITY_LOCALE_CATEGORY static const category // values assigned here are for exposition only none = 0, collate = LC_COLLATE_MASK, ctype = LC_CTYPE_MASK, monetary = LC_MONETARY_MASK, numeric = LC_NUMERIC_MASK, time = LC_TIME_MASK, messages = LC_MESSAGES_MASK, all = collate | ctype | monetary | numeric | time | messages; // construct/copy/destroy: locale() _NOEXCEPT; locale(const locale&) _NOEXCEPT; explicit locale(const char*); explicit locale(const string&); locale(const locale&, const char*, category); locale(const locale&, const string&, category); template _LIBCPP_INLINE_VISIBILITY locale(const locale&, _Facet*); locale(const locale&, const locale&, category); ~locale(); const locale& operator=(const locale&) _NOEXCEPT; template _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS locale combine(const locale&) const; // locale operations: string name() const; bool operator==(const locale&) const; bool operator!=(const locale& __y) const {return !(*this == __y);} template _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool operator()(const basic_string<_CharT, _Traits, _Allocator>&, const basic_string<_CharT, _Traits, _Allocator>&) const; // global locale objects: static locale global(const locale&); static const locale& classic(); private: class __imp; __imp* __locale_; void __install_ctor(const locale&, facet*, long); static locale& __global(); bool has_facet(id&) const; const facet* use_facet(id&) const; template friend bool has_facet(const locale&) _NOEXCEPT; template friend const _Facet& use_facet(const locale&); }; class _LIBCPP_TYPE_VIS locale::facet : public __shared_count { protected: _LIBCPP_INLINE_VISIBILITY explicit facet(size_t __refs = 0) : __shared_count(static_cast(__refs)-1) {} virtual ~facet(); // facet(const facet&) = delete; // effectively done in __shared_count // void operator=(const facet&) = delete; private: virtual void __on_zero_shared() _NOEXCEPT; }; class _LIBCPP_TYPE_VIS locale::id { once_flag __flag_; int32_t __id_; static int32_t __next_id; public: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR id() :__id_(0) {} private: void __init(); void operator=(const id&); // = delete; id(const id&); // = delete; public: // only needed for tests long __get(); friend class locale; friend class locale::__imp; }; template inline _LIBCPP_INLINE_VISIBILITY locale::locale(const locale& __other, _Facet* __f) { __install_ctor(__other, __f, __f ? __f->id.__get() : 0); } template locale locale::combine(const locale& __other) const { if (!_VSTD::has_facet<_Facet>(__other)) __throw_runtime_error("locale::combine: locale missing facet"); return locale(*this, &const_cast<_Facet&>(_VSTD::use_facet<_Facet>(__other))); } template inline _LIBCPP_INLINE_VISIBILITY bool has_facet(const locale& __l) _NOEXCEPT { return __l.has_facet(_Facet::id); } template inline _LIBCPP_INLINE_VISIBILITY const _Facet& use_facet(const locale& __l) { return static_cast(*__l.use_facet(_Facet::id)); } // template class collate; template class _LIBCPP_TEMPLATE_VIS collate : public locale::facet { public: typedef _CharT char_type; typedef basic_string string_type; _LIBCPP_INLINE_VISIBILITY explicit collate(size_t __refs = 0) : locale::facet(__refs) {} _LIBCPP_INLINE_VISIBILITY int compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const { return do_compare(__lo1, __hi1, __lo2, __hi2); } _LIBCPP_INLINE_VISIBILITY string_type transform(const char_type* __lo, const char_type* __hi) const { return do_transform(__lo, __hi); } _LIBCPP_INLINE_VISIBILITY long hash(const char_type* __lo, const char_type* __hi) const { return do_hash(__lo, __hi); } static locale::id id; protected: ~collate(); virtual int do_compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const; virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const {return string_type(__lo, __hi);} virtual long do_hash(const char_type* __lo, const char_type* __hi) const; }; template locale::id collate<_CharT>::id; template collate<_CharT>::~collate() { } template int collate<_CharT>::do_compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const { for (; __lo2 != __hi2; ++__lo1, ++__lo2) { if (__lo1 == __hi1 || *__lo1 < *__lo2) return -1; if (*__lo2 < *__lo1) return 1; } return __lo1 != __hi1; } template long collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const { size_t __h = 0; const size_t __sr = __CHAR_BIT__ * sizeof(size_t) - 8; const size_t __mask = size_t(0xF) << (__sr + 4); for(const char_type* __p = __lo; __p != __hi; ++__p) { __h = (__h << 4) + static_cast(*__p); size_t __g = __h & __mask; __h ^= __g | (__g >> __sr); } return static_cast(__h); } _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate) // template class collate_byname; template class _LIBCPP_TEMPLATE_VIS collate_byname; template <> class _LIBCPP_TYPE_VIS collate_byname : public collate { locale_t __l; public: typedef char char_type; typedef basic_string string_type; explicit collate_byname(const char* __n, size_t __refs = 0); explicit collate_byname(const string& __n, size_t __refs = 0); protected: ~collate_byname(); virtual int do_compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const; virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const; }; template <> class _LIBCPP_TYPE_VIS collate_byname : public collate { locale_t __l; public: typedef wchar_t char_type; typedef basic_string string_type; explicit collate_byname(const char* __n, size_t __refs = 0); explicit collate_byname(const string& __n, size_t __refs = 0); protected: ~collate_byname(); virtual int do_compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const; virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const; }; template bool locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x, const basic_string<_CharT, _Traits, _Allocator>& __y) const { return _VSTD::use_facet<_VSTD::collate<_CharT> >(*this).compare( __x.data(), __x.data() + __x.size(), __y.data(), __y.data() + __y.size()) < 0; } // template class ctype class _LIBCPP_TYPE_VIS ctype_base { public: #if defined(__GLIBC__) typedef unsigned short mask; static const mask space = _ISspace; static const mask print = _ISprint; static const mask cntrl = _IScntrl; static const mask upper = _ISupper; static const mask lower = _ISlower; static const mask alpha = _ISalpha; static const mask digit = _ISdigit; static const mask punct = _ISpunct; static const mask xdigit = _ISxdigit; static const mask blank = _ISblank; #elif defined(_LIBCPP_MSVCRT_LIKE) typedef unsigned short mask; static const mask space = _SPACE; static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT; static const mask cntrl = _CONTROL; static const mask upper = _UPPER; static const mask lower = _LOWER; static const mask alpha = _ALPHA; static const mask digit = _DIGIT; static const mask punct = _PUNCT; static const mask xdigit = _HEX; static const mask blank = _BLANK; # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) # ifdef __APPLE__ typedef __uint32_t mask; # elif defined(__FreeBSD__) typedef unsigned long mask; # elif defined(__EMSCRIPTEN__) || defined(__NetBSD__) typedef unsigned short mask; # endif static const mask space = _CTYPE_S; static const mask print = _CTYPE_R; static const mask cntrl = _CTYPE_C; static const mask upper = _CTYPE_U; static const mask lower = _CTYPE_L; static const mask alpha = _CTYPE_A; static const mask digit = _CTYPE_D; static const mask punct = _CTYPE_P; static const mask xdigit = _CTYPE_X; # if defined(__NetBSD__) static const mask blank = _CTYPE_BL; # else static const mask blank = _CTYPE_B; # endif #elif defined(__sun__) || defined(_AIX) typedef unsigned int mask; static const mask space = _ISSPACE; static const mask print = _ISPRINT; static const mask cntrl = _ISCNTRL; static const mask upper = _ISUPPER; static const mask lower = _ISLOWER; static const mask alpha = _ISALPHA; static const mask digit = _ISDIGIT; static const mask punct = _ISPUNCT; static const mask xdigit = _ISXDIGIT; static const mask blank = _ISBLANK; #elif defined(_NEWLIB_VERSION) // Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h. typedef char mask; static const mask space = _S; static const mask print = _P | _U | _L | _N | _B; static const mask cntrl = _C; static const mask upper = _U; static const mask lower = _L; static const mask alpha = _U | _L; static const mask digit = _N; static const mask punct = _P; static const mask xdigit = _X | _N; static const mask blank = _B; # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT #else typedef unsigned long mask; static const mask space = 1<<0; static const mask print = 1<<1; static const mask cntrl = 1<<2; static const mask upper = 1<<3; static const mask lower = 1<<4; static const mask alpha = 1<<5; static const mask digit = 1<<6; static const mask punct = 1<<7; static const mask xdigit = 1<<8; static const mask blank = 1<<9; #endif static const mask alnum = alpha | digit; static const mask graph = alnum | punct; _LIBCPP_ALWAYS_INLINE ctype_base() {} }; template class _LIBCPP_TEMPLATE_VIS ctype; template <> class _LIBCPP_TYPE_VIS ctype : public locale::facet, public ctype_base { public: typedef wchar_t char_type; _LIBCPP_ALWAYS_INLINE explicit ctype(size_t __refs = 0) : locale::facet(__refs) {} _LIBCPP_ALWAYS_INLINE bool is(mask __m, char_type __c) const { return do_is(__m, __c); } _LIBCPP_ALWAYS_INLINE const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const { return do_is(__low, __high, __vec); } _LIBCPP_ALWAYS_INLINE const char_type* scan_is(mask __m, const char_type* __low, const char_type* __high) const { return do_scan_is(__m, __low, __high); } _LIBCPP_ALWAYS_INLINE const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const { return do_scan_not(__m, __low, __high); } _LIBCPP_ALWAYS_INLINE char_type toupper(char_type __c) const { return do_toupper(__c); } _LIBCPP_ALWAYS_INLINE const char_type* toupper(char_type* __low, const char_type* __high) const { return do_toupper(__low, __high); } _LIBCPP_ALWAYS_INLINE char_type tolower(char_type __c) const { return do_tolower(__c); } _LIBCPP_ALWAYS_INLINE const char_type* tolower(char_type* __low, const char_type* __high) const { return do_tolower(__low, __high); } _LIBCPP_ALWAYS_INLINE char_type widen(char __c) const { return do_widen(__c); } _LIBCPP_ALWAYS_INLINE const char* widen(const char* __low, const char* __high, char_type* __to) const { return do_widen(__low, __high, __to); } _LIBCPP_ALWAYS_INLINE char narrow(char_type __c, char __dfault) const { return do_narrow(__c, __dfault); } _LIBCPP_ALWAYS_INLINE const char_type* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const { return do_narrow(__low, __high, __dfault, __to); } static locale::id id; protected: ~ctype(); virtual bool do_is(mask __m, char_type __c) const; virtual const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const; virtual const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const; virtual const char_type* do_scan_not(mask __m, const char_type* __low, const char_type* __high) const; virtual char_type do_toupper(char_type) const; virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const; virtual char_type do_tolower(char_type) const; virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const; virtual char_type do_widen(char) const; virtual const char* do_widen(const char* __low, const char* __high, char_type* __dest) const; virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const; }; template <> class _LIBCPP_TYPE_VIS ctype : public locale::facet, public ctype_base { const mask* __tab_; bool __del_; public: typedef char char_type; explicit ctype(const mask* __tab = 0, bool __del = false, size_t __refs = 0); _LIBCPP_ALWAYS_INLINE bool is(mask __m, char_type __c) const { return isascii(__c) ? (__tab_[static_cast(__c)] & __m) !=0 : false; } _LIBCPP_ALWAYS_INLINE const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const { for (; __low != __high; ++__low, ++__vec) *__vec = isascii(*__low) ? __tab_[static_cast(*__low)] : 0; return __low; } _LIBCPP_ALWAYS_INLINE const char_type* scan_is (mask __m, const char_type* __low, const char_type* __high) const { for (; __low != __high; ++__low) if (isascii(*__low) && (__tab_[static_cast(*__low)] & __m)) break; return __low; } _LIBCPP_ALWAYS_INLINE const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const { for (; __low != __high; ++__low) if (!(isascii(*__low) && (__tab_[static_cast(*__low)] & __m))) break; return __low; } _LIBCPP_ALWAYS_INLINE char_type toupper(char_type __c) const { return do_toupper(__c); } _LIBCPP_ALWAYS_INLINE const char_type* toupper(char_type* __low, const char_type* __high) const { return do_toupper(__low, __high); } _LIBCPP_ALWAYS_INLINE char_type tolower(char_type __c) const { return do_tolower(__c); } _LIBCPP_ALWAYS_INLINE const char_type* tolower(char_type* __low, const char_type* __high) const { return do_tolower(__low, __high); } _LIBCPP_ALWAYS_INLINE char_type widen(char __c) const { return do_widen(__c); } _LIBCPP_ALWAYS_INLINE const char* widen(const char* __low, const char* __high, char_type* __to) const { return do_widen(__low, __high, __to); } _LIBCPP_ALWAYS_INLINE char narrow(char_type __c, char __dfault) const { return do_narrow(__c, __dfault); } _LIBCPP_ALWAYS_INLINE const char* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const { return do_narrow(__low, __high, __dfault, __to); } static locale::id id; #ifdef _CACHED_RUNES static const size_t table_size = _CACHED_RUNES; #else static const size_t table_size = 256; // FIXME: Don't hardcode this. #endif _LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;} static const mask* classic_table() _NOEXCEPT; #if defined(__GLIBC__) || defined(__EMSCRIPTEN__) static const int* __classic_upper_table() _NOEXCEPT; static const int* __classic_lower_table() _NOEXCEPT; #endif #if defined(__NetBSD__) static const short* __classic_upper_table() _NOEXCEPT; static const short* __classic_lower_table() _NOEXCEPT; #endif protected: ~ctype(); virtual char_type do_toupper(char_type __c) const; virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const; virtual char_type do_tolower(char_type __c) const; virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const; virtual char_type do_widen(char __c) const; virtual const char* do_widen(const char* __low, const char* __high, char_type* __to) const; virtual char do_narrow(char_type __c, char __dfault) const; virtual const char* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const; }; // template class ctype_byname; template class _LIBCPP_TEMPLATE_VIS ctype_byname; template <> class _LIBCPP_TYPE_VIS ctype_byname : public ctype { locale_t __l; public: explicit ctype_byname(const char*, size_t = 0); explicit ctype_byname(const string&, size_t = 0); protected: ~ctype_byname(); virtual char_type do_toupper(char_type) const; virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const; virtual char_type do_tolower(char_type) const; virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const; }; template <> class _LIBCPP_TYPE_VIS ctype_byname : public ctype { locale_t __l; public: explicit ctype_byname(const char*, size_t = 0); explicit ctype_byname(const string&, size_t = 0); protected: ~ctype_byname(); virtual bool do_is(mask __m, char_type __c) const; virtual const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const; virtual const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const; virtual const char_type* do_scan_not(mask __m, const char_type* __low, const char_type* __high) const; virtual char_type do_toupper(char_type) const; virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const; virtual char_type do_tolower(char_type) const; virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const; virtual char_type do_widen(char) const; virtual const char* do_widen(const char* __low, const char* __high, char_type* __dest) const; virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const; }; template inline _LIBCPP_INLINE_VISIBILITY bool isspace(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::space, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool isprint(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::print, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool iscntrl(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::cntrl, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool isupper(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::upper, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool islower(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::lower, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool isalpha(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::alpha, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool isdigit(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::digit, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool ispunct(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::punct, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool isxdigit(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::xdigit, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool isalnum(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::alnum, __c); } template inline _LIBCPP_INLINE_VISIBILITY bool isgraph(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::graph, __c); } template inline _LIBCPP_INLINE_VISIBILITY _CharT toupper(_CharT __c, const locale& __loc) { return use_facet >(__loc).toupper(__c); } template inline _LIBCPP_INLINE_VISIBILITY _CharT tolower(_CharT __c, const locale& __loc) { return use_facet >(__loc).tolower(__c); } // codecvt_base class _LIBCPP_TYPE_VIS codecvt_base { public: _LIBCPP_ALWAYS_INLINE codecvt_base() {} enum result {ok, partial, error, noconv}; }; // template class codecvt; template class _LIBCPP_TEMPLATE_VIS codecvt; // template <> class codecvt template <> class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { public: typedef char intern_type; typedef char extern_type; typedef mbstate_t state_type; _LIBCPP_ALWAYS_INLINE explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {} _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE int encoding() const _NOEXCEPT { return do_encoding(); } _LIBCPP_ALWAYS_INLINE bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE int max_length() const _NOEXCEPT { return do_max_length(); } static locale::id id; protected: _LIBCPP_ALWAYS_INLINE 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& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const; virtual int do_max_length() const _NOEXCEPT; }; // template <> class codecvt template <> class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { locale_t __l; public: typedef wchar_t intern_type; typedef char extern_type; typedef mbstate_t state_type; explicit codecvt(size_t __refs = 0); _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE int encoding() const _NOEXCEPT { return do_encoding(); } _LIBCPP_ALWAYS_INLINE bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE int max_length() const _NOEXCEPT { return do_max_length(); } static locale::id id; protected: explicit codecvt(const char*, size_t __refs = 0); ~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; }; // template <> class codecvt template <> class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { public: typedef char16_t intern_type; typedef char extern_type; typedef mbstate_t state_type; _LIBCPP_ALWAYS_INLINE explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {} _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE int encoding() const _NOEXCEPT { return do_encoding(); } _LIBCPP_ALWAYS_INLINE bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE int max_length() const _NOEXCEPT { return do_max_length(); } static locale::id id; protected: _LIBCPP_ALWAYS_INLINE 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; }; // template <> class codecvt template <> class _LIBCPP_TYPE_VIS codecvt : public locale::facet, public codecvt_base { public: typedef char32_t intern_type; typedef char extern_type; typedef mbstate_t state_type; _LIBCPP_ALWAYS_INLINE explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {} _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE 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_ALWAYS_INLINE int encoding() const _NOEXCEPT { return do_encoding(); } _LIBCPP_ALWAYS_INLINE bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } _LIBCPP_ALWAYS_INLINE 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_ALWAYS_INLINE int max_length() const _NOEXCEPT { return do_max_length(); } static locale::id id; protected: _LIBCPP_ALWAYS_INLINE 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; }; // template class codecvt_byname template class _LIBCPP_TEMPLATE_VIS codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> { public: _LIBCPP_ALWAYS_INLINE explicit codecvt_byname(const char* __nm, size_t __refs = 0) : codecvt<_InternT, _ExternT, _StateT>(__nm, __refs) {} _LIBCPP_ALWAYS_INLINE explicit codecvt_byname(const string& __nm, size_t __refs = 0) : codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {} protected: ~codecvt_byname(); }; template codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname() { } _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); template struct __narrow_to_utf8 { template _OutputIterator operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const; }; template <> struct __narrow_to_utf8<8> { template _LIBCPP_ALWAYS_INLINE _OutputIterator operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const { for (; __wb < __we; ++__wb, ++__s) *__s = *__wb; return __s; } }; template <> struct __narrow_to_utf8<16> : public codecvt { _LIBCPP_ALWAYS_INLINE __narrow_to_utf8() : codecvt(1) {} ~__narrow_to_utf8(); template _LIBCPP_ALWAYS_INLINE _OutputIterator operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const { result __r = ok; mbstate_t __mb; while (__wb < __we && __r != error) { const int __sz = 32; char __buf[__sz]; char* __bn; const char16_t* __wn = (const char16_t*)__wb; __r = do_out(__mb, (const char16_t*)__wb, (const char16_t*)__we, __wn, __buf, __buf+__sz, __bn); if (__r == codecvt_base::error || __wn == (const char16_t*)__wb) __throw_runtime_error("locale not supported"); for (const char* __p = __buf; __p < __bn; ++__p, ++__s) *__s = *__p; __wb = (const _CharT*)__wn; } return __s; } }; template <> struct __narrow_to_utf8<32> : public codecvt { _LIBCPP_ALWAYS_INLINE __narrow_to_utf8() : codecvt(1) {} ~__narrow_to_utf8(); template _LIBCPP_ALWAYS_INLINE _OutputIterator operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const { result __r = ok; mbstate_t __mb; while (__wb < __we && __r != error) { const int __sz = 32; char __buf[__sz]; char* __bn; const char32_t* __wn = (const char32_t*)__wb; __r = do_out(__mb, (const char32_t*)__wb, (const char32_t*)__we, __wn, __buf, __buf+__sz, __bn); if (__r == codecvt_base::error || __wn == (const char32_t*)__wb) __throw_runtime_error("locale not supported"); for (const char* __p = __buf; __p < __bn; ++__p, ++__s) *__s = *__p; __wb = (const _CharT*)__wn; } return __s; } }; template struct __widen_from_utf8 { template _OutputIterator operator()(_OutputIterator __s, const char* __nb, const char* __ne) const; }; template <> struct __widen_from_utf8<8> { template _LIBCPP_ALWAYS_INLINE _OutputIterator operator()(_OutputIterator __s, const char* __nb, const char* __ne) const { for (; __nb < __ne; ++__nb, ++__s) *__s = *__nb; return __s; } }; template <> struct __widen_from_utf8<16> : public codecvt { _LIBCPP_ALWAYS_INLINE __widen_from_utf8() : codecvt(1) {} ~__widen_from_utf8(); template _LIBCPP_ALWAYS_INLINE _OutputIterator operator()(_OutputIterator __s, const char* __nb, const char* __ne) const { result __r = ok; mbstate_t __mb; while (__nb < __ne && __r != error) { const int __sz = 32; char16_t __buf[__sz]; char16_t* __bn; const char* __nn = __nb; __r = do_in(__mb, __nb, __ne - __nb > __sz ? __nb+__sz : __ne, __nn, __buf, __buf+__sz, __bn); if (__r == codecvt_base::error || __nn == __nb) __throw_runtime_error("locale not supported"); for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s) *__s = (wchar_t)*__p; __nb = __nn; } return __s; } }; template <> struct __widen_from_utf8<32> : public codecvt { _LIBCPP_ALWAYS_INLINE __widen_from_utf8() : codecvt(1) {} ~__widen_from_utf8(); template _LIBCPP_ALWAYS_INLINE _OutputIterator operator()(_OutputIterator __s, const char* __nb, const char* __ne) const { result __r = ok; mbstate_t __mb; while (__nb < __ne && __r != error) { const int __sz = 32; char32_t __buf[__sz]; char32_t* __bn; const char* __nn = __nb; __r = do_in(__mb, __nb, __ne - __nb > __sz ? __nb+__sz : __ne, __nn, __buf, __buf+__sz, __bn); if (__r == codecvt_base::error || __nn == __nb) __throw_runtime_error("locale not supported"); for (const char32_t* __p = __buf; __p < __bn; ++__p, ++__s) *__s = (wchar_t)*__p; __nb = __nn; } return __s; } }; // template class numpunct template class _LIBCPP_TEMPLATE_VIS numpunct; template <> class _LIBCPP_TYPE_VIS numpunct : public locale::facet { public: typedef char char_type; typedef basic_string string_type; explicit numpunct(size_t __refs = 0); _LIBCPP_ALWAYS_INLINE char_type decimal_point() const {return do_decimal_point();} _LIBCPP_ALWAYS_INLINE char_type thousands_sep() const {return do_thousands_sep();} _LIBCPP_ALWAYS_INLINE string grouping() const {return do_grouping();} _LIBCPP_ALWAYS_INLINE string_type truename() const {return do_truename();} _LIBCPP_ALWAYS_INLINE string_type falsename() const {return do_falsename();} static locale::id id; protected: ~numpunct(); virtual char_type do_decimal_point() const; virtual char_type do_thousands_sep() const; virtual string do_grouping() const; virtual string_type do_truename() const; virtual string_type do_falsename() const; char_type __decimal_point_; char_type __thousands_sep_; string __grouping_; }; template <> class _LIBCPP_TYPE_VIS numpunct : public locale::facet { public: typedef wchar_t char_type; typedef basic_string string_type; explicit numpunct(size_t __refs = 0); _LIBCPP_ALWAYS_INLINE char_type decimal_point() const {return do_decimal_point();} _LIBCPP_ALWAYS_INLINE char_type thousands_sep() const {return do_thousands_sep();} _LIBCPP_ALWAYS_INLINE string grouping() const {return do_grouping();} _LIBCPP_ALWAYS_INLINE string_type truename() const {return do_truename();} _LIBCPP_ALWAYS_INLINE string_type falsename() const {return do_falsename();} static locale::id id; protected: ~numpunct(); virtual char_type do_decimal_point() const; virtual char_type do_thousands_sep() const; virtual string do_grouping() const; virtual string_type do_truename() const; virtual string_type do_falsename() const; char_type __decimal_point_; char_type __thousands_sep_; string __grouping_; }; // template class numpunct_byname template class _LIBCPP_TEMPLATE_VIS numpunct_byname; template <> class _LIBCPP_TYPE_VIS numpunct_byname : public numpunct { public: typedef char char_type; typedef basic_string string_type; explicit numpunct_byname(const char* __nm, size_t __refs = 0); explicit numpunct_byname(const string& __nm, size_t __refs = 0); protected: ~numpunct_byname(); private: void __init(const char*); }; template <> class _LIBCPP_TYPE_VIS numpunct_byname : public numpunct { public: typedef wchar_t char_type; typedef basic_string string_type; explicit numpunct_byname(const char* __nm, size_t __refs = 0); explicit numpunct_byname(const string& __nm, size_t __refs = 0); protected: ~numpunct_byname(); private: void __init(const char*); }; _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___LOCALE Index: vendor/libc++/dist/include/mutex =================================================================== --- vendor/libc++/dist/include/mutex (revision 322263) +++ vendor/libc++/dist/include/mutex (revision 322264) @@ -1,702 +1,702 @@ // -*- C++ -*- //===--------------------------- mutex ------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_MUTEX #define _LIBCPP_MUTEX /* mutex synopsis namespace std { class mutex { public: constexpr mutex() noexcept; ~mutex(); mutex(const mutex&) = delete; mutex& operator=(const mutex&) = delete; void lock(); bool try_lock(); void unlock(); typedef pthread_mutex_t* native_handle_type; native_handle_type native_handle(); }; class recursive_mutex { public: recursive_mutex(); ~recursive_mutex(); recursive_mutex(const recursive_mutex&) = delete; recursive_mutex& operator=(const recursive_mutex&) = delete; void lock(); bool try_lock() noexcept; void unlock(); typedef pthread_mutex_t* native_handle_type; native_handle_type native_handle(); }; class timed_mutex { public: timed_mutex(); ~timed_mutex(); timed_mutex(const timed_mutex&) = delete; timed_mutex& operator=(const timed_mutex&) = delete; void lock(); bool try_lock(); template bool try_lock_for(const chrono::duration& rel_time); template bool try_lock_until(const chrono::time_point& abs_time); void unlock(); }; class recursive_timed_mutex { public: recursive_timed_mutex(); ~recursive_timed_mutex(); recursive_timed_mutex(const recursive_timed_mutex&) = delete; recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete; void lock(); bool try_lock() noexcept; template bool try_lock_for(const chrono::duration& rel_time); template bool try_lock_until(const chrono::time_point& abs_time); void unlock(); }; struct defer_lock_t {}; struct try_to_lock_t {}; struct adopt_lock_t {}; constexpr defer_lock_t defer_lock{}; constexpr try_to_lock_t try_to_lock{}; constexpr adopt_lock_t adopt_lock{}; template class lock_guard { public: typedef Mutex mutex_type; explicit lock_guard(mutex_type& m); lock_guard(mutex_type& m, adopt_lock_t); ~lock_guard(); lock_guard(lock_guard const&) = delete; lock_guard& operator=(lock_guard const&) = delete; }; template class scoped_lock // C++17 { public: using mutex_type = Mutex; // If MutexTypes... consists of the single type Mutex explicit scoped_lock(MutexTypes&... m); - scoped_lock(MutexTypes&... m, adopt_lock_t); + scoped_lock(adopt_lock_t, MutexTypes&... m); ~scoped_lock(); scoped_lock(scoped_lock const&) = delete; scoped_lock& operator=(scoped_lock const&) = delete; private: tuple pm; // exposition only }; template class unique_lock { public: typedef Mutex mutex_type; unique_lock() noexcept; explicit unique_lock(mutex_type& m); unique_lock(mutex_type& m, defer_lock_t) noexcept; unique_lock(mutex_type& m, try_to_lock_t); unique_lock(mutex_type& m, adopt_lock_t); template unique_lock(mutex_type& m, const chrono::time_point& abs_time); template unique_lock(mutex_type& m, const chrono::duration& rel_time); ~unique_lock(); unique_lock(unique_lock const&) = delete; unique_lock& operator=(unique_lock const&) = delete; unique_lock(unique_lock&& u) noexcept; unique_lock& operator=(unique_lock&& u) noexcept; void lock(); bool try_lock(); template bool try_lock_for(const chrono::duration& rel_time); template bool try_lock_until(const chrono::time_point& abs_time); void unlock(); void swap(unique_lock& u) noexcept; mutex_type* release() noexcept; bool owns_lock() const noexcept; explicit operator bool () const noexcept; mutex_type* mutex() const noexcept; }; template void swap(unique_lock& x, unique_lock& y) noexcept; template int try_lock(L1&, L2&, L3&...); template void lock(L1&, L2&, L3&...); struct once_flag { constexpr once_flag() noexcept; once_flag(const once_flag&) = delete; once_flag& operator=(const once_flag&) = delete; }; template void call_once(once_flag& flag, Callable&& func, Args&&... args); } // std */ #include <__config> #include <__mutex_base> #include #include #ifndef _LIBCPP_CXX03_LANG #include #endif #include <__threading_support> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif _LIBCPP_PUSH_MACROS #include <__undef_macros> _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_HAS_NO_THREADS class _LIBCPP_TYPE_VIS recursive_mutex { __libcpp_recursive_mutex_t __m_; public: recursive_mutex(); ~recursive_mutex(); private: recursive_mutex(const recursive_mutex&); // = delete; recursive_mutex& operator=(const recursive_mutex&); // = delete; public: void lock(); bool try_lock() _NOEXCEPT; void unlock() _NOEXCEPT; typedef __libcpp_recursive_mutex_t* native_handle_type; _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;} }; class _LIBCPP_TYPE_VIS timed_mutex { mutex __m_; condition_variable __cv_; bool __locked_; public: timed_mutex(); ~timed_mutex(); private: timed_mutex(const timed_mutex&); // = delete; timed_mutex& operator=(const timed_mutex&); // = delete; public: void lock(); bool try_lock() _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; template bool timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) { using namespace chrono; unique_lock __lk(__m_); bool no_timeout = _Clock::now() < __t; while (no_timeout && __locked_) no_timeout = __cv_.wait_until(__lk, __t) == cv_status::no_timeout; if (!__locked_) { __locked_ = true; return true; } return false; } class _LIBCPP_TYPE_VIS recursive_timed_mutex { mutex __m_; condition_variable __cv_; size_t __count_; __libcpp_thread_id __id_; public: recursive_timed_mutex(); ~recursive_timed_mutex(); private: recursive_timed_mutex(const recursive_timed_mutex&); // = delete; recursive_timed_mutex& operator=(const recursive_timed_mutex&); // = delete; public: void lock(); bool try_lock() _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; template bool recursive_timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) { using namespace chrono; __libcpp_thread_id __id = __libcpp_thread_get_current_id(); unique_lock lk(__m_); if (__libcpp_thread_id_equal(__id, __id_)) { if (__count_ == numeric_limits::max()) return false; ++__count_; return true; } bool no_timeout = _Clock::now() < __t; while (no_timeout && __count_ != 0) no_timeout = __cv_.wait_until(lk, __t) == cv_status::no_timeout; if (__count_ == 0) { __count_ = 1; __id_ = __id; return true; } return false; } template int try_lock(_L0& __l0, _L1& __l1) { unique_lock<_L0> __u0(__l0, try_to_lock); if (__u0.owns_lock()) { if (__l1.try_lock()) { __u0.release(); return -1; } else return 1; } return 0; } #ifndef _LIBCPP_CXX03_LANG template int try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) { int __r = 0; unique_lock<_L0> __u0(__l0, try_to_lock); if (__u0.owns_lock()) { __r = try_lock(__l1, __l2, __l3...); if (__r == -1) __u0.release(); else ++__r; } return __r; } #endif // _LIBCPP_CXX03_LANG template void lock(_L0& __l0, _L1& __l1) { while (true) { { unique_lock<_L0> __u0(__l0); if (__l1.try_lock()) { __u0.release(); break; } } __libcpp_thread_yield(); { unique_lock<_L1> __u1(__l1); if (__l0.try_lock()) { __u1.release(); break; } } __libcpp_thread_yield(); } } #ifndef _LIBCPP_CXX03_LANG template void __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3) { while (true) { switch (__i) { case 0: { unique_lock<_L0> __u0(__l0); __i = try_lock(__l1, __l2, __l3...); if (__i == -1) { __u0.release(); return; } } ++__i; __libcpp_thread_yield(); break; case 1: { unique_lock<_L1> __u1(__l1); __i = try_lock(__l2, __l3..., __l0); if (__i == -1) { __u1.release(); return; } } if (__i == sizeof...(_L3) + 1) __i = 0; else __i += 2; __libcpp_thread_yield(); break; default: __lock_first(__i - 2, __l2, __l3..., __l0, __l1); return; } } } template inline _LIBCPP_INLINE_VISIBILITY void lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3) { __lock_first(0, __l0, __l1, __l2, __l3...); } template inline _LIBCPP_INLINE_VISIBILITY void __unlock(_L0& __l0) { __l0.unlock(); } template inline _LIBCPP_INLINE_VISIBILITY void __unlock(_L0& __l0, _L1& __l1) { __l0.unlock(); __l1.unlock(); } template inline _LIBCPP_INLINE_VISIBILITY void __unlock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) { __l0.unlock(); __l1.unlock(); _VSTD::__unlock(__l2, __l3...); } #endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 14 template class _LIBCPP_TEMPLATE_VIS scoped_lock; template <> class _LIBCPP_TEMPLATE_VIS scoped_lock<> { public: explicit scoped_lock() {} ~scoped_lock() = default; _LIBCPP_INLINE_VISIBILITY explicit scoped_lock(adopt_lock_t) {} scoped_lock(scoped_lock const&) = delete; scoped_lock& operator=(scoped_lock const&) = delete; }; template class _LIBCPP_TEMPLATE_VIS scoped_lock<_Mutex> { public: typedef _Mutex mutex_type; private: mutex_type& __m_; public: explicit scoped_lock(mutex_type & __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m)) : __m_(__m) {__m_.lock();} ~scoped_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();} _LIBCPP_INLINE_VISIBILITY - explicit scoped_lock(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m)) + explicit scoped_lock(adopt_lock_t, mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m)) : __m_(__m) {} scoped_lock(scoped_lock const&) = delete; scoped_lock& operator=(scoped_lock const&) = delete; }; template class _LIBCPP_TEMPLATE_VIS scoped_lock { static_assert(sizeof...(_MArgs) > 1, "At least 2 lock types required"); typedef tuple<_MArgs&...> _MutexTuple; public: _LIBCPP_INLINE_VISIBILITY explicit scoped_lock(_MArgs&... __margs) : __t_(__margs...) { _VSTD::lock(__margs...); } _LIBCPP_INLINE_VISIBILITY - scoped_lock(_MArgs&... __margs, adopt_lock_t) + scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) { } _LIBCPP_INLINE_VISIBILITY ~scoped_lock() { typedef typename __make_tuple_indices::type _Indices; __unlock_unpack(_Indices{}, __t_); } scoped_lock(scoped_lock const&) = delete; scoped_lock& operator=(scoped_lock const&) = delete; private: template _LIBCPP_INLINE_VISIBILITY static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) { _VSTD::__unlock(_VSTD::get<_Indx>(__mt)...); } _MutexTuple __t_; }; #endif // _LIBCPP_STD_VER > 14 #endif // !_LIBCPP_HAS_NO_THREADS struct _LIBCPP_TEMPLATE_VIS once_flag; #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY void call_once(once_flag&, _Callable&&, _Args&&...); #else // _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY void call_once(once_flag&, _Callable&); template _LIBCPP_INLINE_VISIBILITY void call_once(once_flag&, const _Callable&); #endif // _LIBCPP_CXX03_LANG struct _LIBCPP_TEMPLATE_VIS once_flag { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR once_flag() _NOEXCEPT : __state_(0) {} private: once_flag(const once_flag&); // = delete; once_flag& operator=(const once_flag&); // = delete; unsigned long __state_; #ifndef _LIBCPP_CXX03_LANG template friend void call_once(once_flag&, _Callable&&, _Args&&...); #else // _LIBCPP_CXX03_LANG template friend void call_once(once_flag&, _Callable&); template friend void call_once(once_flag&, const _Callable&); #endif // _LIBCPP_CXX03_LANG }; #ifndef _LIBCPP_CXX03_LANG template class __call_once_param { _Fp& __f_; public: _LIBCPP_INLINE_VISIBILITY explicit __call_once_param(_Fp& __f) : __f_(__f) {} _LIBCPP_INLINE_VISIBILITY void operator()() { typedef typename __make_tuple_indices::value, 1>::type _Index; __execute(_Index()); } private: template _LIBCPP_INLINE_VISIBILITY void __execute(__tuple_indices<_Indices...>) { __invoke(_VSTD::get<0>(_VSTD::move(__f_)), _VSTD::get<_Indices>(_VSTD::move(__f_))...); } }; #else template class __call_once_param { _Fp& __f_; public: _LIBCPP_INLINE_VISIBILITY explicit __call_once_param(_Fp& __f) : __f_(__f) {} _LIBCPP_INLINE_VISIBILITY void operator()() { __f_(); } }; #endif template void __call_once_proxy(void* __vp) { __call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp); (*__p)(); } _LIBCPP_FUNC_VIS void __call_once(volatile unsigned long&, void*, void(*)(void*)); #ifndef _LIBCPP_CXX03_LANG template inline _LIBCPP_INLINE_VISIBILITY void call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) { if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) { typedef tuple<_Callable&&, _Args&&...> _Gp; _Gp __f(_VSTD::forward<_Callable>(__func), _VSTD::forward<_Args>(__args)...); __call_once_param<_Gp> __p(__f); __call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>); } } #else // _LIBCPP_CXX03_LANG template inline _LIBCPP_INLINE_VISIBILITY void call_once(once_flag& __flag, _Callable& __func) { if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) { __call_once_param<_Callable> __p(__func); __call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>); } } template inline _LIBCPP_INLINE_VISIBILITY void call_once(once_flag& __flag, const _Callable& __func) { if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) { __call_once_param __p(__func); __call_once(__flag.__state_, &__p, &__call_once_proxy); } } #endif // _LIBCPP_CXX03_LANG _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS #endif // _LIBCPP_MUTEX Index: vendor/libc++/dist/include/sstream =================================================================== --- vendor/libc++/dist/include/sstream (revision 322263) +++ vendor/libc++/dist/include/sstream (revision 322264) @@ -1,977 +1,978 @@ // -*- C++ -*- //===--------------------------- sstream ----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_SSTREAM #define _LIBCPP_SSTREAM /* sstream synopsis template , class Allocator = allocator > class basic_stringbuf : public basic_streambuf { public: typedef charT char_type; typedef traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; // 27.8.1.1 Constructors: explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out); explicit basic_stringbuf(const basic_string& str, ios_base::openmode which = ios_base::in | ios_base::out); basic_stringbuf(basic_stringbuf&& rhs); // 27.8.1.2 Assign and swap: basic_stringbuf& operator=(basic_stringbuf&& rhs); void swap(basic_stringbuf& rhs); // 27.8.1.3 Get and set: basic_string str() const; void str(const basic_string& s); protected: // 27.8.1.4 Overridden virtual functions: virtual int_type underflow(); virtual int_type pbackfail(int_type c = traits_type::eof()); virtual int_type overflow (int_type c = traits_type::eof()); virtual basic_streambuf* setbuf(char_type*, streamsize); virtual pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out); virtual pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out); }; template void swap(basic_stringbuf& x, basic_stringbuf& y); typedef basic_stringbuf stringbuf; typedef basic_stringbuf wstringbuf; template , class Allocator = allocator > class basic_istringstream : public basic_istream { public: typedef charT char_type; typedef traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; // 27.8.2.1 Constructors: explicit basic_istringstream(ios_base::openmode which = ios_base::in); explicit basic_istringstream(const basic_string& str, ios_base::openmode which = ios_base::in); basic_istringstream(basic_istringstream&& rhs); // 27.8.2.2 Assign and swap: basic_istringstream& operator=(basic_istringstream&& rhs); void swap(basic_istringstream& rhs); // 27.8.2.3 Members: basic_stringbuf* rdbuf() const; basic_string str() const; void str(const basic_string& s); }; template void swap(basic_istringstream& x, basic_istringstream& y); typedef basic_istringstream istringstream; typedef basic_istringstream wistringstream; template , class Allocator = allocator > class basic_ostringstream : public basic_ostream { public: // types: typedef charT char_type; typedef traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; // 27.8.3.1 Constructors/destructor: explicit basic_ostringstream(ios_base::openmode which = ios_base::out); explicit basic_ostringstream(const basic_string& str, ios_base::openmode which = ios_base::out); basic_ostringstream(basic_ostringstream&& rhs); // 27.8.3.2 Assign/swap: basic_ostringstream& operator=(basic_ostringstream&& rhs); void swap(basic_ostringstream& rhs); // 27.8.3.3 Members: basic_stringbuf* rdbuf() const; basic_string str() const; void str(const basic_string& s); }; template void swap(basic_ostringstream& x, basic_ostringstream& y); typedef basic_ostringstream ostringstream; typedef basic_ostringstream wostringstream; template , class Allocator = allocator > class basic_stringstream : public basic_iostream { public: // types: typedef charT char_type; typedef traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; // constructors/destructor explicit basic_stringstream(ios_base::openmode which = ios_base::out|ios_base::in); explicit basic_stringstream(const basic_string& str, ios_base::openmode which = ios_base::out|ios_base::in); basic_stringstream(basic_stringstream&& rhs); // 27.8.5.1 Assign/swap: basic_stringstream& operator=(basic_stringstream&& rhs); void swap(basic_stringstream& rhs); // Members: basic_stringbuf* rdbuf() const; basic_string str() const; void str(const basic_string& str); }; template void swap(basic_stringstream& x, basic_stringstream& y); typedef basic_stringstream stringstream; typedef basic_stringstream wstringstream; } // std */ #include <__config> #include #include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif _LIBCPP_PUSH_MACROS #include <__undef_macros> _LIBCPP_BEGIN_NAMESPACE_STD // basic_stringbuf template class _LIBCPP_TEMPLATE_VIS basic_stringbuf : public basic_streambuf<_CharT, _Traits> { public: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef _Allocator allocator_type; typedef basic_string string_type; private: string_type __str_; mutable char_type* __hm_; ios_base::openmode __mode_; public: // 27.8.1.1 Constructors: inline _LIBCPP_INLINE_VISIBILITY explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out); inline _LIBCPP_INLINE_VISIBILITY explicit basic_stringbuf(const string_type& __s, ios_base::openmode __wch = ios_base::in | ios_base::out); #ifndef _LIBCPP_CXX03_LANG basic_stringbuf(basic_stringbuf&& __rhs); // 27.8.1.2 Assign and swap: basic_stringbuf& operator=(basic_stringbuf&& __rhs); #endif void swap(basic_stringbuf& __rhs); // 27.8.1.3 Get and set: string_type str() const; void str(const string_type& __s); protected: // 27.8.1.4 Overridden virtual functions: virtual int_type underflow(); virtual int_type pbackfail(int_type __c = traits_type::eof()); virtual int_type overflow (int_type __c = traits_type::eof()); virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __wch = ios_base::in | ios_base::out); inline _LIBCPP_INLINE_VISIBILITY virtual pos_type seekpos(pos_type __sp, ios_base::openmode __wch = ios_base::in | ios_base::out); }; template basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch) : __hm_(0), __mode_(__wch) { str(string_type()); } template basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s, ios_base::openmode __wch) - : __hm_(0), + : __str_(__s.get_allocator()), + __hm_(0), __mode_(__wch) { str(__s); } #ifndef _LIBCPP_CXX03_LANG template basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs) : __mode_(__rhs.__mode_) { char_type* __p = const_cast(__rhs.__str_.data()); ptrdiff_t __binp = -1; ptrdiff_t __ninp = -1; ptrdiff_t __einp = -1; if (__rhs.eback() != nullptr) { __binp = __rhs.eback() - __p; __ninp = __rhs.gptr() - __p; __einp = __rhs.egptr() - __p; } ptrdiff_t __bout = -1; ptrdiff_t __nout = -1; ptrdiff_t __eout = -1; if (__rhs.pbase() != nullptr) { __bout = __rhs.pbase() - __p; __nout = __rhs.pptr() - __p; __eout = __rhs.epptr() - __p; } ptrdiff_t __hm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p; __str_ = _VSTD::move(__rhs.__str_); __p = const_cast(__str_.data()); if (__binp != -1) this->setg(__p + __binp, __p + __ninp, __p + __einp); if (__bout != -1) { this->setp(__p + __bout, __p + __eout); this->pbump(__nout); } __hm_ = __hm == -1 ? nullptr : __p + __hm; __p = const_cast(__rhs.__str_.data()); __rhs.setg(__p, __p, __p); __rhs.setp(__p, __p); __rhs.__hm_ = __p; this->pubimbue(__rhs.getloc()); } template basic_stringbuf<_CharT, _Traits, _Allocator>& basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs) { char_type* __p = const_cast(__rhs.__str_.data()); ptrdiff_t __binp = -1; ptrdiff_t __ninp = -1; ptrdiff_t __einp = -1; if (__rhs.eback() != nullptr) { __binp = __rhs.eback() - __p; __ninp = __rhs.gptr() - __p; __einp = __rhs.egptr() - __p; } ptrdiff_t __bout = -1; ptrdiff_t __nout = -1; ptrdiff_t __eout = -1; if (__rhs.pbase() != nullptr) { __bout = __rhs.pbase() - __p; __nout = __rhs.pptr() - __p; __eout = __rhs.epptr() - __p; } ptrdiff_t __hm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p; __str_ = _VSTD::move(__rhs.__str_); __p = const_cast(__str_.data()); if (__binp != -1) this->setg(__p + __binp, __p + __ninp, __p + __einp); else this->setg(nullptr, nullptr, nullptr); if (__bout != -1) { this->setp(__p + __bout, __p + __eout); this->pbump(__nout); } else this->setp(nullptr, nullptr); __hm_ = __hm == -1 ? nullptr : __p + __hm; __mode_ = __rhs.__mode_; __p = const_cast(__rhs.__str_.data()); __rhs.setg(__p, __p, __p); __rhs.setp(__p, __p); __rhs.__hm_ = __p; this->pubimbue(__rhs.getloc()); return *this; } #endif // _LIBCPP_CXX03_LANG template void basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs) { char_type* __p = const_cast(__rhs.__str_.data()); ptrdiff_t __rbinp = -1; ptrdiff_t __rninp = -1; ptrdiff_t __reinp = -1; if (__rhs.eback() != nullptr) { __rbinp = __rhs.eback() - __p; __rninp = __rhs.gptr() - __p; __reinp = __rhs.egptr() - __p; } ptrdiff_t __rbout = -1; ptrdiff_t __rnout = -1; ptrdiff_t __reout = -1; if (__rhs.pbase() != nullptr) { __rbout = __rhs.pbase() - __p; __rnout = __rhs.pptr() - __p; __reout = __rhs.epptr() - __p; } ptrdiff_t __rhm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p; __p = const_cast(__str_.data()); ptrdiff_t __lbinp = -1; ptrdiff_t __lninp = -1; ptrdiff_t __leinp = -1; if (this->eback() != nullptr) { __lbinp = this->eback() - __p; __lninp = this->gptr() - __p; __leinp = this->egptr() - __p; } ptrdiff_t __lbout = -1; ptrdiff_t __lnout = -1; ptrdiff_t __leout = -1; if (this->pbase() != nullptr) { __lbout = this->pbase() - __p; __lnout = this->pptr() - __p; __leout = this->epptr() - __p; } ptrdiff_t __lhm = __hm_ == nullptr ? -1 : __hm_ - __p; _VSTD::swap(__mode_, __rhs.__mode_); __str_.swap(__rhs.__str_); __p = const_cast(__str_.data()); if (__rbinp != -1) this->setg(__p + __rbinp, __p + __rninp, __p + __reinp); else this->setg(nullptr, nullptr, nullptr); if (__rbout != -1) { this->setp(__p + __rbout, __p + __reout); this->pbump(__rnout); } else this->setp(nullptr, nullptr); __hm_ = __rhm == -1 ? nullptr : __p + __rhm; __p = const_cast(__rhs.__str_.data()); if (__lbinp != -1) __rhs.setg(__p + __lbinp, __p + __lninp, __p + __leinp); else __rhs.setg(nullptr, nullptr, nullptr); if (__lbout != -1) { __rhs.setp(__p + __lbout, __p + __leout); __rhs.pbump(__lnout); } else __rhs.setp(nullptr, nullptr); __rhs.__hm_ = __lhm == -1 ? nullptr : __p + __lhm; locale __tl = __rhs.getloc(); __rhs.pubimbue(this->getloc()); this->pubimbue(__tl); } template inline _LIBCPP_INLINE_VISIBILITY void swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x, basic_stringbuf<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } template basic_string<_CharT, _Traits, _Allocator> basic_stringbuf<_CharT, _Traits, _Allocator>::str() const { if (__mode_ & ios_base::out) { if (__hm_ < this->pptr()) __hm_ = this->pptr(); return string_type(this->pbase(), __hm_, __str_.get_allocator()); } else if (__mode_ & ios_base::in) return string_type(this->eback(), this->egptr(), __str_.get_allocator()); return string_type(__str_.get_allocator()); } template void basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s) { __str_ = __s; __hm_ = 0; if (__mode_ & ios_base::in) { __hm_ = const_cast(__str_.data()) + __str_.size(); this->setg(const_cast(__str_.data()), const_cast(__str_.data()), __hm_); } if (__mode_ & ios_base::out) { typename string_type::size_type __sz = __str_.size(); __hm_ = const_cast(__str_.data()) + __sz; __str_.resize(__str_.capacity()); this->setp(const_cast(__str_.data()), const_cast(__str_.data()) + __str_.size()); if (__mode_ & (ios_base::app | ios_base::ate)) this->pbump(__sz); } } template typename basic_stringbuf<_CharT, _Traits, _Allocator>::int_type basic_stringbuf<_CharT, _Traits, _Allocator>::underflow() { if (__hm_ < this->pptr()) __hm_ = this->pptr(); if (__mode_ & ios_base::in) { if (this->egptr() < __hm_) this->setg(this->eback(), this->gptr(), __hm_); if (this->gptr() < this->egptr()) return traits_type::to_int_type(*this->gptr()); } return traits_type::eof(); } template typename basic_stringbuf<_CharT, _Traits, _Allocator>::int_type basic_stringbuf<_CharT, _Traits, _Allocator>::pbackfail(int_type __c) { if (__hm_ < this->pptr()) __hm_ = this->pptr(); if (this->eback() < this->gptr()) { if (traits_type::eq_int_type(__c, traits_type::eof())) { this->setg(this->eback(), this->gptr()-1, __hm_); return traits_type::not_eof(__c); } if ((__mode_ & ios_base::out) || traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1])) { this->setg(this->eback(), this->gptr()-1, __hm_); *this->gptr() = traits_type::to_char_type(__c); return __c; } } return traits_type::eof(); } template typename basic_stringbuf<_CharT, _Traits, _Allocator>::int_type basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c) { if (!traits_type::eq_int_type(__c, traits_type::eof())) { ptrdiff_t __ninp = this->gptr() - this->eback(); if (this->pptr() == this->epptr()) { if (!(__mode_ & ios_base::out)) return traits_type::eof(); #ifndef _LIBCPP_NO_EXCEPTIONS try { #endif // _LIBCPP_NO_EXCEPTIONS ptrdiff_t __nout = this->pptr() - this->pbase(); ptrdiff_t __hm = __hm_ - this->pbase(); __str_.push_back(char_type()); __str_.resize(__str_.capacity()); char_type* __p = const_cast(__str_.data()); this->setp(__p, __p + __str_.size()); this->pbump(__nout); __hm_ = this->pbase() + __hm; #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) { return traits_type::eof(); } #endif // _LIBCPP_NO_EXCEPTIONS } __hm_ = _VSTD::max(this->pptr() + 1, __hm_); if (__mode_ & ios_base::in) { char_type* __p = const_cast(__str_.data()); this->setg(__p, __p + __ninp, __hm_); } return this->sputc(__c); } return traits_type::not_eof(__c); } template typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __wch) { if (__hm_ < this->pptr()) __hm_ = this->pptr(); if ((__wch & (ios_base::in | ios_base::out)) == 0) return pos_type(-1); if ((__wch & (ios_base::in | ios_base::out)) == (ios_base::in | ios_base::out) && __way == ios_base::cur) return pos_type(-1); off_type __noff; switch (__way) { case ios_base::beg: __noff = 0; break; case ios_base::cur: if (__wch & ios_base::in) __noff = this->gptr() - this->eback(); else __noff = this->pptr() - this->pbase(); break; case ios_base::end: __noff = __hm_ - __str_.data(); break; default: return pos_type(-1); } __noff += __off; if (__noff < 0 || __hm_ - __str_.data() < __noff) return pos_type(-1); if (__noff != 0) { if ((__wch & ios_base::in) && this->gptr() == 0) return pos_type(-1); if ((__wch & ios_base::out) && this->pptr() == 0) return pos_type(-1); } if (__wch & ios_base::in) this->setg(this->eback(), this->eback() + __noff, __hm_); if (__wch & ios_base::out) { this->setp(this->pbase(), this->epptr()); this->pbump(__noff); } return pos_type(__noff); } template typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp, ios_base::openmode __wch) { return seekoff(__sp, ios_base::beg, __wch); } // basic_istringstream template class _LIBCPP_TEMPLATE_VIS basic_istringstream : public basic_istream<_CharT, _Traits> { public: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef _Allocator allocator_type; typedef basic_string string_type; private: basic_stringbuf __sb_; public: // 27.8.2.1 Constructors: inline _LIBCPP_INLINE_VISIBILITY explicit basic_istringstream(ios_base::openmode __wch = ios_base::in); inline _LIBCPP_INLINE_VISIBILITY explicit basic_istringstream(const string_type& __s, ios_base::openmode __wch = ios_base::in); #ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_istringstream(basic_istringstream&& __rhs); // 27.8.2.2 Assign and swap: basic_istringstream& operator=(basic_istringstream&& __rhs); #endif // _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY void swap(basic_istringstream& __rhs); // 27.8.2.3 Members: inline _LIBCPP_INLINE_VISIBILITY basic_stringbuf* rdbuf() const; inline _LIBCPP_INLINE_VISIBILITY string_type str() const; inline _LIBCPP_INLINE_VISIBILITY void str(const string_type& __s); }; template basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::openmode __wch) : basic_istream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::in) { } template basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const string_type& __s, ios_base::openmode __wch) : basic_istream<_CharT, _Traits>(&__sb_), __sb_(__s, __wch | ios_base::in) { } #ifndef _LIBCPP_CXX03_LANG template basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs) : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)), __sb_(_VSTD::move(__rhs.__sb_)) { basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_); } template basic_istringstream<_CharT, _Traits, _Allocator>& basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&& __rhs) { basic_istream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); return *this; } #endif // _LIBCPP_CXX03_LANG template void basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs) { basic_istream::swap(__rhs); __sb_.swap(__rhs.__sb_); } template inline _LIBCPP_INLINE_VISIBILITY void swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x, basic_istringstream<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } template basic_stringbuf<_CharT, _Traits, _Allocator>* basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const { return const_cast*>(&__sb_); } template basic_string<_CharT, _Traits, _Allocator> basic_istringstream<_CharT, _Traits, _Allocator>::str() const { return __sb_.str(); } template void basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s) { __sb_.str(__s); } // basic_ostringstream template class _LIBCPP_TEMPLATE_VIS basic_ostringstream : public basic_ostream<_CharT, _Traits> { public: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef _Allocator allocator_type; typedef basic_string string_type; private: basic_stringbuf __sb_; public: // 27.8.2.1 Constructors: inline _LIBCPP_INLINE_VISIBILITY explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out); inline _LIBCPP_INLINE_VISIBILITY explicit basic_ostringstream(const string_type& __s, ios_base::openmode __wch = ios_base::out); #ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_ostringstream(basic_ostringstream&& __rhs); // 27.8.2.2 Assign and swap: basic_ostringstream& operator=(basic_ostringstream&& __rhs); #endif // _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY void swap(basic_ostringstream& __rhs); // 27.8.2.3 Members: inline _LIBCPP_INLINE_VISIBILITY basic_stringbuf* rdbuf() const; inline _LIBCPP_INLINE_VISIBILITY string_type str() const; inline _LIBCPP_INLINE_VISIBILITY void str(const string_type& __s); }; template basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::openmode __wch) : basic_ostream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::out) { } template basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const string_type& __s, ios_base::openmode __wch) : basic_ostream<_CharT, _Traits>(&__sb_), __sb_(__s, __wch | ios_base::out) { } #ifndef _LIBCPP_CXX03_LANG template basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs) : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)), __sb_(_VSTD::move(__rhs.__sb_)) { basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_); } template basic_ostringstream<_CharT, _Traits, _Allocator>& basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&& __rhs) { basic_ostream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); return *this; } #endif // _LIBCPP_CXX03_LANG template void basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rhs) { basic_ostream::swap(__rhs); __sb_.swap(__rhs.__sb_); } template inline _LIBCPP_INLINE_VISIBILITY void swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x, basic_ostringstream<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } template basic_stringbuf<_CharT, _Traits, _Allocator>* basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const { return const_cast*>(&__sb_); } template basic_string<_CharT, _Traits, _Allocator> basic_ostringstream<_CharT, _Traits, _Allocator>::str() const { return __sb_.str(); } template void basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s) { __sb_.str(__s); } // basic_stringstream template class _LIBCPP_TEMPLATE_VIS basic_stringstream : public basic_iostream<_CharT, _Traits> { public: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef _Allocator allocator_type; typedef basic_string string_type; private: basic_stringbuf __sb_; public: // 27.8.2.1 Constructors: inline _LIBCPP_INLINE_VISIBILITY explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out); inline _LIBCPP_INLINE_VISIBILITY explicit basic_stringstream(const string_type& __s, ios_base::openmode __wch = ios_base::in | ios_base::out); #ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_stringstream(basic_stringstream&& __rhs); // 27.8.2.2 Assign and swap: basic_stringstream& operator=(basic_stringstream&& __rhs); #endif // _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY void swap(basic_stringstream& __rhs); // 27.8.2.3 Members: inline _LIBCPP_INLINE_VISIBILITY basic_stringbuf* rdbuf() const; inline _LIBCPP_INLINE_VISIBILITY string_type str() const; inline _LIBCPP_INLINE_VISIBILITY void str(const string_type& __s); }; template basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::openmode __wch) : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(__wch) { } template basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string_type& __s, ios_base::openmode __wch) : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(__s, __wch) { } #ifndef _LIBCPP_CXX03_LANG template basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs) : basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)), __sb_(_VSTD::move(__rhs.__sb_)) { basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_); } template basic_stringstream<_CharT, _Traits, _Allocator>& basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&& __rhs) { basic_iostream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); return *this; } #endif // _LIBCPP_CXX03_LANG template void basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs) { basic_iostream::swap(__rhs); __sb_.swap(__rhs.__sb_); } template inline _LIBCPP_INLINE_VISIBILITY void swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x, basic_stringstream<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } template basic_stringbuf<_CharT, _Traits, _Allocator>* basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const { return const_cast*>(&__sb_); } template basic_string<_CharT, _Traits, _Allocator> basic_stringstream<_CharT, _Traits, _Allocator>::str() const { return __sb_.str(); } template void basic_stringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s) { __sb_.str(__s); } _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS #endif // _LIBCPP_SSTREAM Index: vendor/libc++/dist/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp (revision 322263) +++ vendor/libc++/dist/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp (revision 322264) @@ -1,49 +1,68 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template , class Allocator = allocator > // class basic_stringstream // explicit basic_stringstream(const basic_string& str, // ios_base::openmode which = ios_base::out|ios_base::in); #include #include +template +struct NoDefaultAllocator : std::allocator +{ + template struct rebind { using other = NoDefaultAllocator; }; + NoDefaultAllocator(int id_) : id(id_) { } + template NoDefaultAllocator(const NoDefaultAllocator& a) : id(a.id) { } + int id; +}; + + int main() { { std::stringstream ss(" 123 456 "); assert(ss.rdbuf() != 0); assert(ss.good()); assert(ss.str() == " 123 456 "); int i = 0; ss >> i; assert(i == 123); ss >> i; assert(i == 456); ss << i << ' ' << 123; assert(ss.str() == "456 1236 "); } { std::wstringstream ss(L" 123 456 "); assert(ss.rdbuf() != 0); assert(ss.good()); assert(ss.str() == L" 123 456 "); int i = 0; ss >> i; assert(i == 123); ss >> i; assert(i == 456); ss << i << ' ' << 123; assert(ss.str() == L"456 1236 "); + } + { // This is https://bugs.llvm.org/show_bug.cgi?id=33727 + typedef std::basic_string , NoDefaultAllocator > S; + typedef std::basic_stringbuf, NoDefaultAllocator > SB; + + S s(NoDefaultAllocator(1)); + SB sb(s); + // This test is not required by the standard, but *where else* could it get the allocator? + assert(sb.str().get_allocator() == s.get_allocator()); } } Index: vendor/libc++/dist/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp (revision 322263) +++ vendor/libc++/dist/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp (revision 322264) @@ -1,72 +1,72 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11, c++14 // // template class scoped_lock; -// scoped_lock(Mutex&..., adopt_lock_t); +// scoped_lock(adopt_lock_t, Mutex&...); #include #include #include "test_macros.h" struct TestMutex { bool locked = false; TestMutex() = default; void lock() { assert(!locked); locked = true; } bool try_lock() { if (locked) return false; locked = true; return true; } void unlock() { assert(locked); locked = false; } TestMutex(TestMutex const&) = delete; TestMutex& operator=(TestMutex const&) = delete; }; int main() { { using LG = std::scoped_lock<>; LG lg(std::adopt_lock); } { TestMutex m1; using LG = std::scoped_lock; m1.lock(); { - LG lg(m1, std::adopt_lock); + LG lg(std::adopt_lock, m1); assert(m1.locked); } assert(!m1.locked); } { TestMutex m1, m2; using LG = std::scoped_lock; m1.lock(); m2.lock(); { - LG lg(m1, m2, std::adopt_lock); + LG lg(std::adopt_lock, m1, m2); assert(m1.locked && m2.locked); } assert(!m1.locked && !m2.locked); } { TestMutex m1, m2, m3; using LG = std::scoped_lock; m1.lock(); m2.lock(); m3.lock(); { - LG lg(m1, m2, m3, std::adopt_lock); + LG lg(std::adopt_lock, m1, m2, m3); assert(m1.locked && m2.locked && m3.locked); } assert(!m1.locked && !m2.locked && !m3.locked); } } Index: vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp (revision 322263) +++ vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp (revision 322264) @@ -1,264 +1,273 @@ // -*- C++ -*- //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 // 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 // XFAIL: with_system_cxx_lib=macosx10.7 // XFAIL: with_system_cxx_lib=macosx10.8 // // template class variant; // variant(variant const&); #include #include #include #include "test_macros.h" #include "test_workarounds.h" struct NonT { NonT(int v) : value(v) {} NonT(const NonT &o) : value(o.value) {} int value; }; static_assert(!std::is_trivially_copy_constructible::value, ""); struct NoCopy { NoCopy(const NoCopy &) = delete; }; struct MoveOnly { MoveOnly(const MoveOnly &) = delete; MoveOnly(MoveOnly &&) = default; }; struct MoveOnlyNT { MoveOnlyNT(const MoveOnlyNT &) = delete; MoveOnlyNT(MoveOnlyNT &&) {} }; struct NTCopy { constexpr NTCopy(int v) : value(v) {} NTCopy(const NTCopy &that) : value(that.value) {} NTCopy(NTCopy &&) = delete; int value; }; static_assert(!std::is_trivially_copy_constructible::value, ""); static_assert(std::is_copy_constructible::value, ""); struct TCopy { constexpr TCopy(int v) : value(v) {} TCopy(TCopy const &) = default; TCopy(TCopy &&) = delete; int value; }; static_assert(std::is_trivially_copy_constructible::value, ""); struct TCopyNTMove { constexpr TCopyNTMove(int v) : value(v) {} TCopyNTMove(const TCopyNTMove&) = default; TCopyNTMove(TCopyNTMove&& that) : value(that.value) { that.value = -1; } int value; }; static_assert(std::is_trivially_copy_constructible::value, ""); #ifndef TEST_HAS_NO_EXCEPTIONS struct MakeEmptyT { static int alive; MakeEmptyT() { ++alive; } MakeEmptyT(const MakeEmptyT &) { ++alive; // Don't throw from the copy constructor since variant's assignment // operator performs a copy before committing to the assignment. } MakeEmptyT(MakeEmptyT &&) { throw 42; } MakeEmptyT &operator=(const MakeEmptyT &) { throw 42; } MakeEmptyT &operator=(MakeEmptyT &&) { throw 42; } ~MakeEmptyT() { --alive; } }; int MakeEmptyT::alive = 0; template void makeEmpty(Variant &v) { Variant v2(std::in_place_type); try { v = std::move(v2); assert(false); } catch (...) { assert(v.valueless_by_exception()); } } #endif // TEST_HAS_NO_EXCEPTIONS void test_copy_ctor_sfinae() { { using V = std::variant; static_assert(std::is_copy_constructible::value, ""); } { using V = std::variant; static_assert(!std::is_copy_constructible::value, ""); } { using V = std::variant; static_assert(!std::is_copy_constructible::value, ""); } { using V = std::variant; static_assert(!std::is_copy_constructible::value, ""); } // The following tests are for not-yet-standardized behavior (P0602): { using V = std::variant; static_assert(std::is_trivially_copy_constructible::value, ""); } { using V = std::variant; static_assert(!std::is_trivially_copy_constructible::value, ""); static_assert(std::is_copy_constructible::value, ""); } { using V = std::variant; static_assert(std::is_trivially_copy_constructible::value, ""); } { using V = std::variant; static_assert(std::is_trivially_copy_constructible::value, ""); } } void test_copy_ctor_basic() { { std::variant v(std::in_place_index<0>, 42); std::variant v2 = v; assert(v2.index() == 0); assert(std::get<0>(v2) == 42); } { std::variant v(std::in_place_index<1>, 42); std::variant v2 = v; assert(v2.index() == 1); assert(std::get<1>(v2) == 42); } { std::variant v(std::in_place_index<0>, 42); assert(v.index() == 0); std::variant v2(v); assert(v2.index() == 0); assert(std::get<0>(v2).value == 42); } { std::variant v(std::in_place_index<1>, 42); assert(v.index() == 1); std::variant v2(v); assert(v2.index() == 1); assert(std::get<1>(v2).value == 42); } // The following tests are for not-yet-standardized behavior (P0602): { constexpr std::variant v(std::in_place_index<0>, 42); static_assert(v.index() == 0, ""); constexpr std::variant v2 = v; static_assert(v2.index() == 0, ""); static_assert(std::get<0>(v2) == 42, ""); } { constexpr std::variant v(std::in_place_index<1>, 42); static_assert(v.index() == 1, ""); constexpr std::variant v2 = v; static_assert(v2.index() == 1, ""); static_assert(std::get<1>(v2) == 42, ""); } { constexpr std::variant v(std::in_place_index<0>, 42); static_assert(v.index() == 0, ""); constexpr std::variant v2(v); static_assert(v2.index() == 0, ""); static_assert(std::get<0>(v2).value == 42, ""); } { constexpr std::variant v(std::in_place_index<1>, 42); static_assert(v.index() == 1, ""); constexpr std::variant v2(v); static_assert(v2.index() == 1, ""); static_assert(std::get<1>(v2).value == 42, ""); } { constexpr std::variant v(std::in_place_index<0>, 42); static_assert(v.index() == 0, ""); constexpr std::variant v2(v); static_assert(v2.index() == 0, ""); static_assert(std::get<0>(v2).value == 42, ""); } { constexpr std::variant v(std::in_place_index<1>, 42); static_assert(v.index() == 1, ""); constexpr std::variant v2(v); static_assert(v2.index() == 1, ""); static_assert(std::get<1>(v2).value == 42, ""); } } void test_copy_ctor_valueless_by_exception() { #ifndef TEST_HAS_NO_EXCEPTIONS using V = std::variant; V v1; makeEmpty(v1); const V &cv1 = v1; V v(cv1); assert(v.valueless_by_exception()); #endif // TEST_HAS_NO_EXCEPTIONS } template constexpr bool test_constexpr_copy_ctor_extension_imp( std::variant const& v) { auto v2 = v; return v2.index() == v.index() && v2.index() == Idx && std::get(v2) == std::get(v); } void test_constexpr_copy_ctor_extension() { // NOTE: This test is for not yet standardized behavior. (P0602) using V = std::variant; #ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE static_assert(std::is_trivially_destructible::value, ""); static_assert(std::is_trivially_copy_constructible::value, ""); static_assert(std::is_trivially_move_constructible::value, ""); static_assert(!std::is_copy_assignable::value, ""); static_assert(!std::is_move_assignable::value, ""); #else // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE static_assert(std::is_trivially_copyable::value, ""); #endif // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE static_assert(test_constexpr_copy_ctor_extension_imp<0>(V(42l)), ""); static_assert(test_constexpr_copy_ctor_extension_imp<1>(V(nullptr)), ""); static_assert(test_constexpr_copy_ctor_extension_imp<2>(V(101)), ""); } int main() { test_copy_ctor_basic(); test_copy_ctor_valueless_by_exception(); test_copy_ctor_sfinae(); test_constexpr_copy_ctor_extension(); +#if 0 +// disable this for the moment; it fails on older compilers. +// Need to figure out which compilers will support it. +{ // This is the motivating example from P0739R0 + std::variant v1(3); + std::variant v2 = v1; + (void) v2; +} +#endif } Index: vendor/libc++/dist/www/cxx1z_status.html =================================================================== --- vendor/libc++/dist/www/cxx1z_status.html (revision 322263) +++ vendor/libc++/dist/www/cxx1z_status.html (revision 322264) @@ -1,503 +1,505 @@ libc++ C++1Z Status

libc++ C++1z Status

In November 2014, the C++ standard committee created a draft for the next version of the C++ standard, known here as "C++1z" (probably to be C++17).

In February 2017, the C++ standard committee approved this draft, and sent it to ISO for approval as C++17

This page shows the status of libc++; the status of clang's support of the language features is here.

+

Reminder: Features in unreleased drafts of the standard are subject to change.

+

The groups that have contributed papers:

  • LWG - Library working group
  • CWG - Core Language Working group
  • SG1 - Study group #1 (Concurrency working group)

Paper Status

- +
Paper #GroupPaper NameMeetingStatusFirst released version
N3911LWGTransformationTrait Alias void_t.UrbanaComplete3.6
N4089LWGSafe conversions in unique_ptr<T[]>.UrbanaIn progress3.9
N4169LWGA proposal to add invoke function templateUrbanaComplete3.7
N4190LWGRemoving auto_ptr, random_shuffle(), And Old Stuff.UrbanaIn progress
N4258LWGCleaning-up noexcept in the Library.UrbanaIn progress3.7
N4259CWGWording for std::uncaught_exceptionsUrbanaComplete3.7
N4277LWGTriviallyCopyable reference_wrapper.UrbanaComplete3.2
N4279LWGImproved insertion interface for unique-key maps.UrbanaComplete3.7
N4280LWGNon-member size() and moreUrbanaComplete3.6
N4284LWGContiguous Iterators.UrbanaComplete3.6
N4285CWGCleanup for exception-specification and throw-expression.UrbanaComplete4.0
N4387LWGimproving pair and tupleLenexaComplete4.0
N4389LWGbool_constantLenexaComplete3.7
N4508LWGshared_mutex for C++17LenexaComplete3.7
N4366LWGLWG 2228 missing SFINAE ruleLenexaComplete3.1
N4510LWGMinimal incomplete type support for standard containers, revision 4LenexaComplete3.6
P0004R1LWGRemove Deprecated iostreams aliases.KonaComplete3.8
P0006R0LWGAdopt Type Traits Variable Templates for C++17.KonaComplete3.8
P0092R1LWGPolishing <chrono>KonaComplete3.8
P0007R1LWGConstant View: A proposal for a std::as_const helper function template.KonaComplete3.8
P0156R0LWGVariadic lock_guard(rev 3).KonaReverted in Kona3.9
P0074R0LWGMaking std::owner_less more flexibleKonaComplete3.8
P0013R1LWGLogical type traits rev 2KonaComplete3.8
P0024R2LWGThe Parallelism TS Should be StandardizedJacksonville
P0226R1LWGMathematical Special Functions for C++17Jacksonville
P0220R1LWGAdopt Library Fundamentals V1 TS Components for C++17JacksonvilleIn Progress
P0218R1LWGAdopt the File System TS for C++17JacksonvilleIn Progress
P0033R1LWGRe-enabling shared_from_thisJacksonvilleComplete3.9
P0005R4LWGAdopt not_fn from Library Fundamentals 2 for C++17JacksonvilleComplete3.9
P0152R1LWGconstexpr atomic::is_always_lock_freeJacksonvilleComplete3.9
P0185R1LWGAdding [nothrow-]swappable traitsJacksonvilleComplete3.9
P0253R1LWGFixing a design mistake in the searchers interfaceJacksonvilleComplete3.9
P0025R0LWGAn algorithm to "clamp" a value between a pair of boundary valuesJacksonvilleComplete3.9
P0154R1LWGconstexpr std::hardware_{constructive,destructive}_interference_sizeJacksonville
P0030R1LWGProposal to Introduce a 3-Argument Overload to std::hypotJacksonvilleComplete3.9
P0031R0LWGA Proposal to Add Constexpr Modifiers to reverse_iterator, move_iterator, array and Range AccessJacksonvilleComplete4.0
P0272R1LWGGive std::string a non-const .data() member functionJacksonvilleComplete3.9
P0077R2LWGis_callable, the missing INVOKE related traitJacksonvilleComplete3.9
p0032r3LWGHomogeneous interface for variant, any and optionalOuluComplete4.0
p0040r3LWGExtending memory management toolsOuluComplete4.0
p0063r3LWGC++17 should refer to C11 instead of C99OuluNothing to don/a
p0067r3LWGElementary string conversionsOuluNow P0067R5
p0083r3LWGSplicing Maps and SetsOulu
p0084r2LWGEmplace Return TypeOuluComplete4.0
p0088r3LWGVariant: a type-safe union for C++17OuluComplete4.0
p0163r0LWGshared_ptr::weak_typeOuluComplete3.9
p0174r2LWGDeprecating Vestigial Library Parts in C++17Oulu
p0175r1LWGSynopses for the C libraryOulu
p0180r2LWGReserve a New Library Namespace for Future StandardizationOuluNothing to don/a
p0181r1LWGOrdered by DefaultOuluRemoved in Konan/a
p0209r2LWGmake_from_tuple: apply for constructionOuluComplete3.9
p0219r1LWGRelative Paths for FilesystemOulu
p0254r2LWGIntegrating std::string_view and std::stringOuluComplete4.0
p0258r2LWGhas_unique_object_representationsOulu
p0295r0LWGAdopt Selected Library Fundamentals V2 Components for C++17OuluComplete4.0
p0302r1LWGRemoving Allocator Support in std::functionOuluComplete4.0
p0307r2LWGMaking Optional Greater Equal AgainOuluComplete4.0
p0336r1LWGBetter Names for Parallel Execution Policies in C++17Oulu
p0337r0LWGDelete operator= for polymorphic_allocatorOuluComplete3.9
p0346r1LWGA <random> Nomenclature TweakOuluComplete3.9
p0358r1LWGFixes for not_fnOuluComplete3.9
p0371r1LWGTemporarily discourage memory_order_consumeOuluNothing to don/a
p0392r0LWGAdapting string_view by filesystem pathsOuluComplete4.0
p0393r3LWGMaking Variant Greater EqualOuluComplete4.0
P0394r4LWGHotel Parallelifornia: terminate() for Parallel Algorithms Exception HandlingOulu
P0003R5LWGRemoving Deprecated Exception Specifications from C++17IssaquahComplete5.0
P0067R5LWGElementary string conversions, revision 5Issaquah
P0403R1LWGLiteral suffixes for basic_string_viewIssaquahComplete4.0
P0414R2LWGMerging shared_ptr changes from Library Fundamentals to C++17Issaquah
P0418R2LWGFail or succeed: there is no atomic latticeIssaquah
P0426R1LWGConstexpr for std::char_traitsIssaquahComplete4.0
P0435R1LWGResolving LWG Issues re common_typeIssaquahComplete4.0
P0502R0LWGThrowing out of a parallel algorithm terminates - but how?Issaquah
P0503R0LWGCorrecting library usage of "literal type"IssaquahComplete4.0
P0504R0LWGRevisiting in-place tag types for any/optional/variantIssaquahComplete4.0
P0505R0LWGWording for GB 50 - constexpr for chronoIssaquahComplete4.0
P0508R0LWGWording for GB 58 - structured bindings for node_handlesIssaquah
P0509R1LWGUpdating “Restrictions on exception handling”IssaquahNothing to don/a
P0510R0LWGDisallowing references, incomplete types, arrays, and empty variantsIssaquahComplete4.0
P0513R0LWGPoisoning the HashIssaquahComplete5.0
P0516R0LWGClarify That shared_future’s Copy Operations have Wide ContractsIssaquahComplete4.0
P0517R0LWGMake future_error ConstructibleIssaquahComplete4.0
P0521R0LWGProposed Resolution for CA 14 (shared_ptr use_count/unique)IssaquahNothing to don/a
P0156R2LWGVariadic Lock guard(rev 5)KonaComplete5.0
P0270R3CWGRemoving C dependencies from signal handler wordingKona
P0298R3CWGA byte type definitionKonaComplete5.0
P0317R1LWGDirectory Entry Caching for FilesystemKona
P0430R2LWGFile system library on non-POSIX-like operating systemsKona
P0433R2LWGToward a resolution of US7 and US14: Integrating template deduction for class templates into the standard libraryKona
P0452R1LWGUnifying <numeric> Parallel AlgorithmsKona
P0467R2LWGIterator Concerns for Parallel AlgorithmsKona
P0492R2LWGProposed Resolution of C++17 National Body Comments for FilesystemsKona
P0518R1LWGAllowing copies as arguments to function objects given to parallel algorithms in response to CH11Kona
P0523R1LWGWording for CH 10: Complexity of parallel algorithmsKona
P0548R1LWGcommon_type and durationKonaComplete5.0
P0558R1LWGResolving atomic<T> named base class inconsistenciesKona
P0574R1LWGAlgorithm Complexity Constraints and Parallel OverloadsKona
P0599R1LWGnoexcept for hash functionsKonaComplete5.0
P0604R0LWGResolving GB 55, US 84, US 85, US 86Kona
P0607R0LWGInline Variables for the Standard LibraryKona
P0618R0LWGDeprecating <codecvt>Kona
P0623R0LWGFinal C++17 Parallel Algorithms FixesKona
P0682R1LWGRepairing elementary string conversionsToronto
P0739R0LWGSome improvements to class template argument deduction integration into the standard libraryToronto
P0739R0LWGSome improvements to class template argument deduction integration into the standard libraryTorontoComplete5.0

[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]

Library Working group Issues Status

Issue #Issue NameMeetingStatus
2016Allocators must be no-throw swappableUrbanaComplete
2118unique_ptr for array does not support cv qualification conversion of actual argumentUrbanaComplete
2170Aggregates cannot be DefaultConstructibleUrbanaComplete
2308Clarify container destructor requirements w.r.t. std::arrayUrbanaComplete
2340Replacement allocation functions declared as inlineUrbanaComplete
2354Unnecessary copying when inserting into maps with braced-init syntaxUrbanaComplete
2377std::align requirements overly strictUrbanaComplete
2396underlying_type doesn't say what to do for an incomplete enumeration typeUrbanaComplete
2399shared_ptr's constructor from unique_ptr should be constrainedUrbanaComplete
2400shared_ptr's get_deleter() should use addressof()UrbanaComplete
2401std::function needs more noexceptUrbanaComplete
2404mismatch()'s complexity needs to be updatedUrbanaComplete
2408SFINAE-friendly common_type / iterator_traits is missing in C++14UrbanaComplete
2106move_iterator wrapping iterators returning prvaluesUrbanaComplete
2129User specializations of std::initializer_listUrbanaComplete
2212tuple_size for const pair request headerUrbanaComplete
2217operator==(sub_match, string) slices on embedded '\0'sUrbanaComplete
2230"see below" for initializer_list constructors of unordered containersUrbanaComplete
2233bad_function_call::what() unhelpfulUrbanaComplete
2266vector and deque have incorrect insert requirementsUrbanaComplete
2325minmax_element()'s behavior differing from max_element()'s should be notedUrbanaComplete
2361Apply 2299 resolution throughout libraryUrbanaComplete
2365Missing noexcept in shared_ptr::shared_ptr(nullptr_t)UrbanaComplete
2376bad_weak_ptr::what() overspecifiedUrbanaComplete
2387More nested types that must be accessible and unambiguousUrbanaComplete
2059C++0x ambiguity problem with map::eraseLenexaComplete
2063Contradictory requirements for string move assignmentLenexaComplete
2076Bad CopyConstructible requirement in set constructorsLenexaComplete
2160Unintended destruction ordering-specification of resizeLenexaComplete
2168Inconsistent specification of uniform_real_distribution constructorLenexaComplete
2239min/max/minmax requirementsLenexaComplete
2364deque and vector pop_back don't specify iterator invalidation requirementsLenexaComplete
2369constexpr max(initializer_list) vs max_elementLenexaComplete
2378Behaviour of standard exception typesLenexaComplete
2403stof() should call strtof() and wcstof()LenexaComplete
2406negative_binomial_distribution should reject p == 1LenexaComplete
2407packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicitLenexaComplete
2411shared_ptr is only contextually convertible to boolLenexaComplete
2415Inconsistency between unique_ptr and shared_ptrLenexaComplete
2420function does not discard the return value of the target objectLenexaComplete
2425operator delete(void*, size_t) doesn't invalidate pointers sufficientlyLenexaComplete
2427Container adaptors as sequence containers, reduxLenexaComplete
2428"External declaration" used without being definedLenexaComplete
2433uninitialized_copy()/etc. should tolerate overloaded operator&LenexaComplete
2434shared_ptr::use_count() is efficientLenexaComplete
2437iterator_traits::reference can and can't be voidLenexaComplete
2438std::iterator inheritance shouldn't be mandatedLenexaComplete
2439unique_copy() sometimes can't fall back to reading its outputLenexaComplete
2440seed_seq::size() should be noexceptLenexaComplete
2442call_once() shouldn't DECAY_COPY()LenexaComplete
2448Non-normative Container destructor specificationLenexaComplete
2454Add raw_storage_iterator::base() memberLenexaComplete
2455Allocator default construction should be allowed to throwLenexaComplete
2458N3778 and new library deallocation signaturesLenexaComplete
2459std::polar should require a non-negative rhoLenexaComplete
2464try_emplace and insert_or_assign misspecifiedLenexaComplete
2467is_always_equal has slightly inconsistent defaultLenexaComplete
2470Allocator's destroy function should be allowed to fail to instantiateLenexaComplete
2482[c.strings] Table 73 mentions nonexistent functionsLenexaComplete
2488Placeholders should be allowed and encouraged to be constexprLenexaComplete
1169num_get not fully compatible with strto*KonaComplete
2072Unclear wording about capacity of temporary buffersKonaComplete
2101Some transformation types can produce impossible typesKonaComplete
2111Which unexpected/terminate handler is called from the exception handling runtime?KonaComplete
2119Missing hash specializations for extended integer typesKonaComplete
2127Move-construction with raw_storage_iteratorKonaComplete
2133Attitude to overloaded comma for iteratorsKonaComplete
2156Unordered containers' reserve(n) reserves for n-1 elementsKonaComplete
2218Unclear how containers use allocator_traits::construct()KonaComplete
2219INVOKE-ing a pointer to member with a reference_wrapper as the object expressionKonaComplete
2224Ambiguous status of access to non-live objectsKonaComplete
2234assert() should allow usage in constant expressionsKonaComplete
2244Issue on basic_istream::seekgKonaComplete
2250Follow-up On Library Issue 2207KonaComplete
2259Issues in 17.6.5.5 rules for member functionsKonaComplete
2273regex_match ambiguityKona
2336is_trivially_constructible/is_trivially_assignable traits are always falseKonaComplete
2353std::next is over-constrainedKonaComplete
2367pair and tuple are not correctly implemented for is_constructible with no argsKonaComplete
2380May <cstdlib> provide long ::abs(long) and long long ::abs(long long)?KonaComplete
2384Allocator's deallocate function needs better specificationKonaComplete
2385function::assign allocator argument doesn't make senseKonaComplete
2435reference_wrapper::operator()'s Remark should be deletedKonaComplete
2447Allocators and volatile-qualified value typesKonaComplete
2462std::ios_base::failure is overspecifiedKonaComplete
2466allocator_traits::max_size() default behavior is incorrectKonaComplete
2469Wrong specification of Requires clause of operator[] for map and unordered_mapKonaComplete
2473basic_filebuf's relation to C FILE semanticsKonaComplete
2476scoped_allocator_adaptor is not assignableKonaComplete
2477Inconsistency of wordings in std::vector::erase() and std::deque::erase()KonaComplete
2483throw_with_nested() should use is_finalKonaComplete
2484rethrow_if_nested() is doubly unimplementableKonaComplete
2485get() should be overloaded for const tuple&&KonaComplete
2486mem_fn() should be required to use perfect forwardingKonaComplete
2487bind() should be const-overloaded, not cv-overloadedKonaComplete
2489mem_fn() should be noexceptKonaComplete
2492Clarify requirements for compKonaComplete
2495There is no such thing as an Exception Safety elementKonaComplete
2192Validity and return type of std::abs(0u) is unclearJacksonville
2276Missing requirement on std::promise::set_exceptionJacksonvilleComplete
2296std::addressof should be constexprJacksonvilleComplete (Clang Only)
2450(greater|less|greater_equal|less_equal)<void> do not yield a total order for pointersJacksonvilleComplete
2520N4089 broke initializing unique_ptr<T[]> from a nullptrJacksonvilleComplete
2522[fund.ts.v2] Contradiction in set_default_resource specificationJacksonvilleComplete
2523std::promise synopsis shows two set_value_at_thread_exit()'s for no apparent reasonJacksonvilleComplete
2537Constructors for priority_queue taking allocators should call make_heapJacksonvilleComplete
2539[fund.ts.v2] invocation_trait definition definition doesn't work for surrogate call functionsJacksonville
2545Simplify wording for bind without explicitly specified return typeJacksonvilleComplete
2557Logical operator traits are broken in the zero-argument caseJacksonvilleComplete
2558[fund.ts.v2] Logical operator traits are broken in the zero-argument caseJacksonvilleComplete
2559Error in LWG 2234's resolutionJacksonvilleComplete
2560is_constructible underspecified when applied to a function typeJacksonvilleBroken in 3.6; See r261653.
2565std::function's move constructor should guarantee nothrow for reference_wrappers and function pointersJacksonvilleComplete
2566Requirements on the first template parameter of container adaptorsJacksonvilleComplete
2571§[map.modifiers]/2 imposes nonsensical requirement on insert(InputIterator, InputIterator)JacksonvilleComplete
2572The remarks for shared_ptr::operator* should apply to cv-qualified void as wellJacksonvilleComplete
2574[fund.ts.v2] std::experimental::function::operator=(F&&) should be constrainedJacksonville
2575[fund.ts.v2] experimental::function::assign should be removedJacksonville
2576istream_iterator and ostream_iterator should use std::addressofJacksonvilleComplete
2577{shared,unique}_lock should use std::addressofJacksonvilleComplete
2579Inconsistency wrt Allocators in basic_string assignment vs. basic_string::assignJacksonvilleComplete
2581Specialization of <type_traits> variable templates should be prohibitedJacksonvilleComplete
2582§[res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traitsJacksonvilleComplete
2583There is no way to supply an allocator for basic_string(str, pos)JacksonvilleComplete
2585forward_list::resize(size_type, const value_type&) effects incorrectJacksonvilleComplete
2586Wrong value category used in scoped_allocator_adaptor::construct()Jacksonville
2590Aggregate initialization for std::arrayJacksonvilleComplete
2181Exceptions from seed sequence operationsOuluComplete
2309mutex::lock() should not throw device_or_resource_busyOuluComplete
2310Public exposition only member in std::arrayOuluComplete
2312tuple's constructor constraints need to be phrased more preciselyOuluComplete
2328Rvalue stream extraction should use perfect forwardingOuluComplete
2393std::function's Callable definition is brokenOuluComplete
2422std::numeric_limits<T>::is_modulo description: "most machines" errataOuluComplete
2426Issue about compare_exchangeOulu
2436Comparators for associative containers should always be CopyConstructibleOuluComplete
2441Exact-width atomic typedefs should be providedOuluComplete
2451[fund.ts.v2] optional should 'forward' T's implicit conversionsOulu
2509[fund.ts.v2] any_cast doesn't work with rvalue reference targets and cannot move with a value targetOuluComplete
2516[fund.ts.v2] Public "exposition only" members in observer_ptrOulu
2542Missing const requirements for associative containersOulu
2549Tuple EXPLICIT constructor templates that take tuple parameters end up taking references to temporaries and will create dangling referencesOuluComplete
2550Wording of unordered container's clear() method complexityOuluComplete
2551[fund.ts.v2] "Exception safety" cleanup in library fundamentals requiredOuluComplete
2555[fund.ts.v2] No handling for over-aligned types in optionalOuluComplete
2573[fund.ts.v2] std::hash<std::experimental::shared_ptr> does not work for arraysOulu
2596vector::data() should use addressofOuluComplete
2667path::root_directory() description is confusingOuluComplete
2669recursive_directory_iterator effects refers to non-existent functionsOuluComplete
2670system_complete refers to undefined variable 'base'OuluComplete
2671Errors in CopyOuluComplete
2673status() effects cannot be implemented as specifiedOuluComplete
2674Bidirectional iterator requirement on path::iterator is very expensiveOuluComplete
2683filesystem::copy() says "no effects"OuluComplete
2684priority_queue lacking comparator typedefOuluComplete
2685shared_ptr deleters must not throw on move constructionOuluComplete
2687{inclusive,exclusive}_scan misspecifiedOulu
2688clamp misses preconditions and has extraneous condition on resultOuluComplete
2689Parallel versions of std::copy and std::move shouldn't be in orderOulu
2698Effect of assign() on iterators/pointers/referencesOuluComplete
2704recursive_directory_iterator's members should require '*this is dereferenceable'OuluComplete
2706Error reporting for recursive_directory_iterator::pop() is under-specifiedOuluComplete
2707path construction and assignment should have "string_type&&" overloadsOuluComplete
2709offsetof is unnecessarily impreciseOulu
2710"Effects: Equivalent to ..." doesn't count "Synchronization:" as determined semanticsOuluComplete
2711path is convertible from approximately everything under the sunOuluComplete
2716Specification of shuffle and sample disallows lvalue URNGsOuluComplete
2718Parallelism bug in [algorithms.parallel.exec] p2Oulu
2719permissions function should not be noexcept due to narrow contractOuluComplete
2720permissions function incorrectly specified for symlinksOuluComplete
2721remove_all has incorrect post conditionsOuluComplete
2723Do directory_iterator and recursive_directory_iterator become the end iterator upon error?OuluComplete
2724The protected virtual member functions of memory_resource should be privateOulu
2725filesystem::exists(const path&, error_code&) error reportingOuluComplete
2726[recursive_]directory_iterator::increment(error_code&) is underspecifiedOuluComplete
2727Parallel algorithms with constexpr specifierOulu
2728status(p).permissions() and symlink_status(p).permissions() are not specifiedOuluComplete
2062Effect contradictions w/o no-throw guarantee of std::function swapsIssaquahComplete
2166Heap property underspecified?Issaquah
2221No formatted output operator for nullptrIssaquah
2223shrink_to_fit effect on iterator validityIssaquahComplete
2261Are containers required to use their 'pointer' type internally?Issaquah
2394locale::name specification unclear - what is implementation-defined?IssaquahComplete
2460LWG issue 2408 and value categoriesIssaquahComplete
2468Self-move-assignment of library typesIssaquah
2475Allow overwriting of std::basic_string terminator with charT() to allow cleaner interoperation with legacy APIsIssaquahComplete
2503multiline option should be added to syntax_option_typeIssaquah
2510Tag types should not be DefaultConstructibleIssaquah
2514Type traits must not be finalIssaquahComplete
2518[fund.ts.v2] Non-member swap for propagate_const should call member swapIssaquah
2519Iterator operator-= has gratuitous undefined behaviourIssaquahComplete
2521[fund.ts.v2] weak_ptr's converting move constructor should be modified as well for array supportIssaquah
2525[fund.ts.v2] get_memory_resource should be const and noexceptIssaquah
2527[fund.ts.v2] ALLOCATOR_OF for function::operator= has incorrect defaultIssaquah
2531future::get should explicitly state that the shared state is releasedIssaquah
2534Constrain rvalue stream operatorsIssaquah
2536What should <complex.h> do?IssaquahComplete
2540unordered_multimap::insert hint iteratorIssaquahComplete
2543LWG 2148 (hash support for enum types) seems under-specifiedIssaquahComplete
2544istreambuf_iterator(basic_streambuf* s) effects unclear when s is 0IssaquahComplete
2556Wide contract for future::share()IssaquahComplete
2562Consistent total ordering of pointers by comparison functorsIssaquah
2567Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraitsIssaquahComplete
2568[fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraitsIssaquah
2569conjunction and disjunction requirements are too strictIssaquahComplete
2570[fund.ts.v2] conjunction and disjunction requirements are too strictIssaquah
2578Iterator requirements should reference iterator traitsIssaquahComplete
2584 ECMAScript IdentityEscape is ambiguousIssaquah
2588[fund.ts.v2] "Convertible to bool" requirement in conjunction and disjunctionIssaquah
2589match_results can't satisfy the requirements of a containerIssaquahComplete
2591std::function's member template target() should not lead to undefined behaviourIssaquahComplete
2598addressof works on temporariesIssaquahComplete
2664operator/ (and other append) semantics not useful if argument has rootIssaquahComplete
2665remove_filename() post condition is incorrectIssaquahComplete
2672Should is_empty use error_code in its specification?IssaquahComplete
2678std::filesystem enum classes overspecifiedIssaquahComplete
2679Inconsistent Use of Effects and Equivalent ToIssaquahComplete
2680Add "Equivalent to" to filesystemIssaquahComplete
2681filesystem::copy() cannot copy symlinksIssaquahComplete
2682filesystem::copy() won't create a symlink to a directoryIssaquahComplete
2686Why is std::hash specialized for error_code, but not error_condition?IssaquahComplete
2694Application of LWG 436 accidentally deleted definition of "facet"IssaquahComplete
2696Interaction between make_shared and enable_shared_from_this is underspecifiedIssaquah
2699Missing restriction in [numeric.requirements]IssaquahComplete
2712copy_file(from, to, ...) has a number of unspecified error conditionsIssaquahComplete
2722equivalent incorrectly specifies throws clauseIssaquahComplete
2729Missing SFINAE on std::pair::operator=Issaquah
2732Questionable specification of path::operator/= and path::appendIssaquahComplete
2733[fund.ts.v2] gcd / lcm and boolIssaquahComplete
2735std::abs(short), std::abs(signed char) and others should return int instead of double in order to be compatible with C++98 and CIssaquah
2736nullopt_t insufficiently constrainedIssaquahComplete
2738is_constructible with void typesIssaquahComplete
2739Issue with time_point non-member subtraction with an unsigned durationIssaquahComplete
2740constexpr optional::operator->IssaquahComplete
2742Inconsistent string interface taking string_viewIssaquahComplete
2744any's in_place constructorsIssaquahComplete
2745[fund.ts.v2] Implementability of LWG 2451Issaquah
2747Possibly redundant std::move in [alg.foreach]IssaquahComplete
2748swappable traits for optionalsIssaquahComplete
2749swappable traits for variantsIssaquahComplete
2750[fund.ts.v2] LWG 2451 conversion constructor constraintIssaquah
2752"Throws:" clauses of async and packaged_task are unimplementableIssaquah
2755[string.view.io] uses non-existent basic_string_view::to_string functionIssaquahComplete
2756C++ WP optional should 'forward' T's implicit conversionsIssaquahComplete
2758std::string{}.assign("ABCDE", 0, 1) is ambiguousIssaquahComplete
2759gcd / lcm and bool for the WPIssaquahComplete
2760non-const basic_string::data should not invalidate iteratorsIssaquahComplete
2765Did LWG 1123 go too far?IssaquahComplete
2767not_fn call_wrapper can form invalid typesIssaquahComplete
2769Redundant const in the return type of any_cast(const any&)IssaquahComplete
2771Broken Effects of some basic_string::compare functions in terms of basic_string_viewIssaquahComplete
2773Making std::ignore constexprIssaquahComplete
2777basic_string_view::copy should use char_traits::copyIssaquahComplete
2778basic_string_view is missing constexprIssaquahComplete
2260Missing requirement for Allocator::pointerKona
2676Provide filesystem::path overloads for File-based streamsKona
2768any_cast and move semanticsKonaComplete
2769Redundant const in the return type of any_cast(const any&)KonaComplete
2781Contradictory requirements for std::function and std::reference_wrapperKonaComplete
2782scoped_allocator_adaptor constructors must be constrainedKonaComplete
2784Resolution to LWG 2484 is missing "otherwise, no effects" and is hard to parseKonaComplete
2785quoted should work with basic_string_viewKonaComplete
2786Annex C should mention shared_ptr changes for array supportKonaComplete
2787§[file_status.cons] doesn't match class definitionKonaComplete
2788basic_string range mutators unintentionally require a default constructible allocatorKonaComplete
2789Equivalence of contained objectsKonaComplete
2790Missing specification of istreambuf_iterator::operator->KonaComplete
2794Missing requirements for allocator pointersKona
2795§[global.functions] provides incorrect example of ADL useKonaComplete
2796tuple should be a literal typeKonaComplete
2801Default-constructibility of unique_ptrKonaComplete
2802shared_ptr constructor requirements for a deleterKona
2804Unconditional constexpr default constructor for istream_iteratorKonaComplete
2806Base class of bad_optional_accessKonaComplete
2807std::invoke should use std::is_nothrow_callableKona
2812Range access is available with <string_view>KonaComplete
2824list::sort should say that the order of elements is unspecified if an exception is thrownKona
2826string_view iterators use old wordingKonaComplete
2834Resolution LWG 2223 is missing wording about end iteratorsKonaComplete
2835LWG 2536 seems to misspecify <tgmath.h>Kona
2837gcd and lcm should support a wider range of input valuesKonaComplete
2838is_literal_type specification needs a little cleanupKonaComplete
2842in_place_t check for optional::optional(U&&) should decay UKonaComplete
2850std::function move constructor does unnecessary workKonaComplete
2853Possible inconsistency in specification of erase in [vector.modifiers]KonaComplete
2855std::throw_with_nested("string_literal")KonaComplete
2857{variant,optional,any}::emplace should return the constructed valueKonaComplete
2861basic_string should require that charT match traits::char_typeKonaComplete
2866Incorrect derived classes constraintsKona
2868Missing specification of bad_any_cast::what()KonaComplete
2872Add definition for direct-non-list-initializationKonaComplete
2873Add noexcept to several shared_ptr related functionsKonaComplete
2874Constructor shared_ptr::shared_ptr(Y*) should be constrainedKona
2875shared_ptr::shared_ptr(Y*, D, […]) constructors should be constrainedKona
2876shared_ptr::shared_ptr(const weak_ptr<Y>&) constructor should be constrainedKona
2878Missing DefaultConstructible requirement for istream_iterator default constructorKona
2890The definition of 'object state' applies only to class typesKonaComplete
2900The copy and move constructors of optional are not constexprKonaComplete
2903The form of initialization for the emplace-constructors is not specifiedKona
2904Make variant move-assignment more exception safeKonaComplete
2905is_constructible_v<unique_ptr<P, D>, P, D const &> should be false when D is not copy constructibleKonaComplete
2908The less-than operator for shared pointers could do moreKona
2911An is_aggregate type trait is neededKonaComplete
2921packaged_task and type-erased allocatorsKona
2934optional<const T> doesn't compare with TKonaComplete
2901Variants cannot properly support allocatorsTorontoComplete
2955to_chars / from_chars depend on std::stringTorontoResolved by P0682R1
2956filesystem::canonical() still defined in terms of absolute(p, base)TorontoComplete
-

Last Updated: 25-May-2017

+

Last Updated: 27-Jul-2017

Index: vendor/libc++/dist/www/cxx2a_status.html =================================================================== --- vendor/libc++/dist/www/cxx2a_status.html (revision 322263) +++ vendor/libc++/dist/www/cxx2a_status.html (revision 322264) @@ -1,90 +1,92 @@ libc++ C++2a Status

libc++ C++2a Status

In July 2017, the C++ standard committee created a draft for the next version of the C++ standard, known here as "C++2a" (probably to be C++20).

This page shows the status of libc++; the status of clang's support of the language features is here.

+

Reminder: Features in unreleased drafts of the standard are subject to change.

+

The groups that have contributed papers:

  • LWG - Library working group
  • CWG - Core Language Working group
  • SG1 - Study group #1 (Concurrency working group)

Paper Status

Paper #GroupPaper NameMeetingStatusFirst released version
P0463R1LWGEndian just EndianToronto
P0674R1LWGExtending make_shared to Support ArraysToronto

[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]

Library Working group Issues Status

Issue #Issue NameMeetingStatus
2070allocate_shared should use allocator_traits<A>::constructTorontoResolved by P0674R1
2444Inconsistent complexity for std::sort_heapToronto
2593Moved-from state of AllocatorsToronto
2597std::log misspecified for complex numbersToronto
2783stack::emplace() and queue::emplace() should return decltype(auto)Toronto
2932Constraints on parallel algorithm implementations are underspecifiedToronto
2937Is equivalent("existing_thing", "not_existing_thing") an errorTorontoComplete
2940result_of specification also needs a little cleanupToronto
2942LWG 2873's resolution missed weak_ptr::owner_beforeToronto
2954Specialization of the convenience variable templates should be prohibitedToronto
2961Bad postcondition for set_default_resourceToronto
2966Incomplete resolution of US 74TorontoNothing to do
2974Diagnose out of bounds tuple_element/variant_alternativeTorontoComplete

Last Updated: 16-Jul-2017