aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__locale
diff options
context:
space:
mode:
authorarmenqa <armenqa@yandex-team.com>2024-01-19 12:23:50 +0300
committerarmenqa <armenqa@yandex-team.com>2024-01-19 13:10:03 +0300
commit2de0149d0151c514b22bca0760b95b26c9b0b578 (patch)
tree2bfed9f3bce7e643ddf048bb61ce3dc0a714bcc2 /contrib/libs/cxxsupp/libcxx/include/__locale
parenta8c06d218f12b2406fbce24d194885c5d7b68503 (diff)
downloadydb-2de0149d0151c514b22bca0760b95b26c9b0b578.tar.gz
feat contrib: aiogram 3
Relates: https://st.yandex-team.ru/, https://st.yandex-team.ru/
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__locale')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__locale116
1 files changed, 60 insertions, 56 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale b/contrib/libs/cxxsupp/libcxx/include/__locale
index 3aa8e7505c..0fe43dcb3e 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__locale
+++ b/contrib/libs/cxxsupp/libcxx/include/__locale
@@ -16,13 +16,15 @@
#include <cctype>
#include <cstdint>
#include <locale.h>
-#include <memory>
#include <mutex>
#include <string>
+// Some platforms require more includes than others. Keep the includes on all plaforms for now.
+#include <cstddef>
+#include <cstring>
+
#if defined(_LIBCPP_MSVCRT_LIKE)
# include <__support/win32/locale_win32.h>
-# include <cstring>
#elif defined(_AIX) || defined(__MVS__)
# include <__support/ibm/xlocale.h>
#elif defined(__ANDROID__)
@@ -192,12 +194,12 @@ protected:
explicit facet(size_t __refs = 0)
: __shared_count(static_cast<long>(__refs)-1) {}
- virtual ~facet();
+ ~facet() override;
// facet(const facet&) = delete; // effectively done in __shared_count
// void operator=(const facet&) = delete;
private:
- virtual void __on_zero_shared() _NOEXCEPT;
+ void __on_zero_shared() _NOEXCEPT override;
};
class _LIBCPP_TYPE_VIS locale::id
@@ -289,7 +291,7 @@ public:
static locale::id id;
protected:
- ~collate();
+ ~collate() override;
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
@@ -348,7 +350,7 @@ template <>
class _LIBCPP_TYPE_VIS collate_byname<char>
: public collate<char>
{
- locale_t __l;
+ locale_t __l_;
public:
typedef char char_type;
typedef basic_string<char_type> string_type;
@@ -357,10 +359,10 @@ public:
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;
+ ~collate_byname() override;
+ int do_compare(const char_type* __lo1, const char_type* __hi1,
+ const char_type* __lo2, const char_type* __hi2) const override;
+ string_type do_transform(const char_type* __lo, const char_type* __hi) const override;
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -368,7 +370,7 @@ template <>
class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
: public collate<wchar_t>
{
- locale_t __l;
+ locale_t __l_;
public:
typedef wchar_t char_type;
typedef basic_string<char_type> string_type;
@@ -377,11 +379,11 @@ public:
explicit collate_byname(const string& __n, size_t __refs = 0);
protected:
- ~collate_byname();
+ ~collate_byname() override;
- 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;
+ int do_compare(const char_type* __lo1, const char_type* __hi1,
+ const char_type* __lo2, const char_type* __hi2) const override;
+ string_type do_transform(const char_type* __lo, const char_type* __hi) const override;
};
#endif
@@ -508,7 +510,8 @@ public:
static const mask punct = _P;
static const mask xdigit = _X | _N;
static const mask blank = _B;
- static const mask __regex_word = 0x80;
+ // mask is already fully saturated, use a different type in regex_type_traits.
+ static const unsigned short __regex_word = 0x100;
# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT
@@ -547,7 +550,8 @@ public:
_LIBCPP_INLINE_VISIBILITY ctype_base() {}
- static_assert((__regex_word & ~(space | print | cntrl | upper | lower | alpha | digit | punct | xdigit | blank)) == __regex_word,
+ static_assert((__regex_word & ~(std::make_unsigned<mask>::type)(space | print | cntrl | upper | lower | alpha |
+ digit | punct | xdigit | blank)) == __regex_word,
"__regex_word can't overlap other bits");
};
@@ -641,7 +645,7 @@ public:
static locale::id id;
protected:
- ~ctype();
+ ~ctype() override;
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;
@@ -695,7 +699,7 @@ public:
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<int>(*__low)] & __m)))
+ if (!isascii(*__low) || !(__tab_[static_cast<int>(*__low)] & __m))
break;
return __low;
}
@@ -771,7 +775,7 @@ public:
#endif
protected:
- ~ctype();
+ ~ctype() override;
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;
@@ -790,18 +794,18 @@ template <>
class _LIBCPP_TYPE_VIS ctype_byname<char>
: public ctype<char>
{
- locale_t __l;
+ 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;
+ ~ctype_byname() override;
+ char_type do_toupper(char_type) const override;
+ const char_type* do_toupper(char_type* __low, const char_type* __high) const override;
+ char_type do_tolower(char_type) const override;
+ const char_type* do_tolower(char_type* __low, const char_type* __high) const override;
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -809,26 +813,26 @@ template <>
class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
: public ctype<wchar_t>
{
- locale_t __l;
+ 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;
+ ~ctype_byname() override;
+ bool do_is(mask __m, char_type __c) const override;
+ const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const override;
+ const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const override;
+ const char_type* do_scan_not(mask __m, const char_type* __low, const char_type* __high) const override;
+ char_type do_toupper(char_type) const override;
+ const char_type* do_toupper(char_type* __low, const char_type* __high) const override;
+ char_type do_tolower(char_type) const override;
+ const char_type* do_tolower(char_type* __low, const char_type* __high) const override;
+ char_type do_widen(char) const override;
+ const char* do_widen(const char* __low, const char* __high, char_type* __dest) const override;
+ char do_narrow(char_type, char __dfault) const override;
+ const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const override;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -1019,7 +1023,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1043,7 +1047,7 @@ class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
: public locale::facet,
public codecvt_base
{
- locale_t __l;
+ locale_t __l_;
public:
typedef wchar_t intern_type;
typedef char extern_type;
@@ -1103,7 +1107,7 @@ public:
protected:
explicit codecvt(const char*, size_t __refs = 0);
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1190,7 +1194,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1278,7 +1282,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1366,7 +1370,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1454,7 +1458,7 @@ protected:
explicit codecvt(const char*, size_t __refs = 0)
: locale::facet(__refs) {}
- ~codecvt();
+ ~codecvt() override;
virtual result do_out(state_type& __st,
const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
@@ -1486,7 +1490,7 @@ public:
explicit codecvt_byname(const string& __nm, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}
protected:
- ~codecvt_byname();
+ ~codecvt_byname() override;
};
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -1538,7 +1542,7 @@ struct _LIBCPP_TYPE_VIS __narrow_to_utf8<16>
__narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__narrow_to_utf8();
+ ~__narrow_to_utf8() override;
template <class _OutputIterator, class _CharT>
_LIBCPP_INLINE_VISIBILITY
@@ -1574,7 +1578,7 @@ struct _LIBCPP_TYPE_VIS __narrow_to_utf8<32>
__narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__narrow_to_utf8();
+ ~__narrow_to_utf8() override;
template <class _OutputIterator, class _CharT>
_LIBCPP_INLINE_VISIBILITY
@@ -1632,7 +1636,7 @@ struct _LIBCPP_TYPE_VIS __widen_from_utf8<16>
__widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__widen_from_utf8();
+ ~__widen_from_utf8() override;
template <class _OutputIterator>
_LIBCPP_INLINE_VISIBILITY
@@ -1668,7 +1672,7 @@ struct _LIBCPP_TYPE_VIS __widen_from_utf8<32>
__widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
- ~__widen_from_utf8();
+ ~__widen_from_utf8() override;
template <class _OutputIterator>
_LIBCPP_INLINE_VISIBILITY
@@ -1718,7 +1722,7 @@ public:
static locale::id id;
protected:
- ~numpunct();
+ ~numpunct() override;
virtual char_type do_decimal_point() const;
virtual char_type do_thousands_sep() const;
virtual string do_grouping() const;
@@ -1750,7 +1754,7 @@ public:
static locale::id id;
protected:
- ~numpunct();
+ ~numpunct() override;
virtual char_type do_decimal_point() const;
virtual char_type do_thousands_sep() const;
virtual string do_grouping() const;
@@ -1779,7 +1783,7 @@ public:
explicit numpunct_byname(const string& __nm, size_t __refs = 0);
protected:
- ~numpunct_byname();
+ ~numpunct_byname() override;
private:
void __init(const char*);
@@ -1798,7 +1802,7 @@ public:
explicit numpunct_byname(const string& __nm, size_t __refs = 0);
protected:
- ~numpunct_byname();
+ ~numpunct_byname() override;
private:
void __init(const char*);