aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/regex
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/regex
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/regex')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/regex59
1 files changed, 44 insertions, 15 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/regex b/contrib/libs/cxxsupp/libcxx/include/regex
index 26887e84bf..f35197339b 100644
--- a/contrib/libs/cxxsupp/libcxx/include/regex
+++ b/contrib/libs/cxxsupp/libcxx/include/regex
@@ -769,20 +769,17 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <__iterator/back_insert_iterator.h>
#include <__iterator/wrap_iter.h>
#include <__locale>
+#include <__memory_resource/polymorphic_allocator.h>
#include <__utility/move.h>
+#include <__utility/pair.h>
#include <__utility/swap.h>
+#include <cstring>
#include <deque>
-#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
#include <version>
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
-# include <iterator>
-# include <utility>
-#endif
-
// standard-mandated includes
// [iterator.range]
@@ -833,7 +830,7 @@ enum syntax_option_type
multiline = 1 << 10
};
-inline _LIBCPP_CONSTEXPR
+_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR
syntax_option_type __get_grammar(syntax_option_type __g)
{
#ifdef _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
@@ -1006,8 +1003,8 @@ class _LIBCPP_EXCEPTION_ABI regex_error
public:
explicit regex_error(regex_constants::error_type __ecode);
regex_error(const regex_error&) _NOEXCEPT = default;
- virtual ~regex_error() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ ~regex_error() _NOEXCEPT override;
+ _LIBCPP_INLINE_VISIBILITY
regex_constants::error_type code() const {return __code_;}
};
@@ -1029,7 +1026,7 @@ public:
typedef _CharT char_type;
typedef basic_string<char_type> string_type;
typedef locale locale_type;
-#ifdef __BIONIC__
+#if defined(__BIONIC__) || defined(_NEWLIB_VERSION)
// Originally bionic's ctype_base used its own ctype masks because the
// builtin ctype implementation wasn't in libc++ yet. Bionic's ctype mask
// was only 8 bits wide and already saturated, so it used a wider type here
@@ -1038,6 +1035,11 @@ public:
// implementation, but this was not updated to match. Since then Android has
// needed to maintain a stable libc++ ABI, and this can't be changed without
// an ABI break.
+ // We also need this workaround for newlib since _NEWLIB_VERSION is not
+ // defined yet inside __config, so we can't set the
+ // _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE macro. Additionally, newlib is
+ // often used for space constrained environments, so it makes sense not to
+ // duplicate the ctype table.
typedef uint16_t char_class_type;
#else
typedef ctype_base::mask char_class_type;
@@ -1507,7 +1509,7 @@ public:
explicit __owns_one_state(__node<_CharT>* __s)
: base(__s) {}
- virtual ~__owns_one_state();
+ ~__owns_one_state() override;
};
template <class _CharT>
@@ -2196,7 +2198,7 @@ public:
__match_any_but_newline(__node<_CharT>* __s)
: base(__s) {}
- virtual void __exec(__state&) const;
+ void __exec(__state&) const override;
};
template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<char>::__exec(__state&) const;
@@ -5732,7 +5734,7 @@ match_results<_BidirectionalIterator, _Allocator>::swap(match_results& __m)
}
template <class _BidirectionalIterator, class _Allocator>
-bool
+_LIBCPP_HIDE_FROM_ABI bool
operator==(const match_results<_BidirectionalIterator, _Allocator>& __x,
const match_results<_BidirectionalIterator, _Allocator>& __y)
{
@@ -6224,7 +6226,7 @@ regex_search(const basic_string<_Cp, _ST, _SA>&& __s,
// regex_match
template <class _BidirectionalIterator, class _Allocator, class _CharT, class _Traits>
-bool
+_LIBCPP_HIDE_FROM_ABI bool
regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
match_results<_BidirectionalIterator, _Allocator>& __m,
const basic_regex<_CharT, _Traits>& __e,
@@ -6737,7 +6739,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
template <class _OutputIterator, class _BidirectionalIterator,
class _Traits, class _CharT>
-_OutputIterator
+_LIBCPP_HIDE_FROM_ABI _OutputIterator
regex_replace(_OutputIterator __output_iter,
_BidirectionalIterator __first, _BidirectionalIterator __last,
const basic_regex<_CharT, _Traits>& __e, const _CharT* __fmt,
@@ -6842,6 +6844,33 @@ regex_replace(const _CharT* __s,
_LIBCPP_END_NAMESPACE_STD
+#if _LIBCPP_STD_VER > 14
+_LIBCPP_BEGIN_NAMESPACE_STD
+namespace pmr {
+template <class _BidirT>
+using match_results = std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
+
+using cmatch = match_results<const char*>;
+using smatch = match_results<std::pmr::string::const_iterator>;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wcmatch = match_results<const wchar_t*>;
+using wsmatch = match_results<std::pmr::wstring::const_iterator>;
+#endif
+} // namespace pmr
+_LIBCPP_END_NAMESPACE_STD
+#endif
+
_LIBCPP_POP_MACROS
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <atomic>
+# include <concepts>
+# include <iosfwd>
+# include <iterator>
+# include <new>
+# include <typeinfo>
+# include <utility>
+#endif
+
#endif // _LIBCPP_REGEX