summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/regex
diff options
context:
space:
mode:
authormikhnenko <[email protected]>2025-02-25 10:55:30 +0300
committermikhnenko <[email protected]>2025-02-25 11:10:50 +0300
commitba3f1646a3a22daceac94dd0cd330152b1d5b5b5 (patch)
tree16da0d516f0c768c219e6f0fc7351676e390873f /contrib/libs/cxxsupp/libcxx/include/regex
parentdda9be9e1fde150b4473d9d10ec1a0d3829f7482 (diff)
Update libcxx to 8 July 2024
{% cut "Change log" %} ``` [libc++] Add a test case for std::bit_cast with std::complex (#97751) [libc++] Update status after the St. Louis meeting. (#97951) [libc++] Guard transitive include of `<locale>` with availability macro (#97869) [libc++] Restore `__synth_three_way` lambda (#90398) [libc++][TZDB] Makes implementation experimental. (#95657) [libc++] Remove dead code from the locale base API and support code (#89070) [libc++] Assume newer LLVM versions for not-yet-released macOS versions [libc++] Remove annotations for GCC 13 and update the documentation (#97744) [libc++][test] Updates sized deallocation tests. (#97833) [libc++] Adds a missing include. [libc++] Use __is_array if the builtin is fixed (#93037) [libc++] Use _Complex for multiplication and division of complex floating point types (#83575) [libc++] Adds a new feature-test macro generator class. (#90889) [libc++][chrono] Fixes leap seconds. (#90070) [libc++] Upgrade to GCC 14 (#97205) [libc++] Fix the signatures of `std::rethrow_if_nested` (#91365) [libc++] Use GCC compilers from compiler explorer (#97219) Add a regression test for recent regression in pair. (#97355) [libcxx][Docs] Correct link syntax in hardening docs [libc++] Don't use a ppa for GCC [libc++] Upgrade to GCC 14 in the CI (#95212) [libc++abi] Fix test failures with GCC 14 (#95759) [libc++] Clean up and update deployment target features (#96312) [libc++] Fix how we pass /MANIFEST flag on Windows without clang-cl (#96967) [libc++] Classify iota_view precondition (#96662) [libc++] restrict the expected conversion constructor not compete against copy constructor (#96101) "[libc++] Try again LWG3233 Broken requirements for shared_ptr converting constructors" (#96103) [libc++] LWG3382: NTTP for `pair` and `array` (#85811) [libc++] Get the GCC build mostly clean of warnings (#96604) [libc++] P3029R1: Better `mdspan`'s CTAD - `std::extents` (#89015) [libc++] Move allocator assertion into allocator_traits (#94750) [libc++] change the visibility of libc++ header to public in libcxx module (#91240) [libc++] Use _If for conditional_t (#96193) [libc++] Remove the allocator<const T> extension (#96319) [libc++] Fix incorrect overflow checking in std::lcm (#96310) [libc++] Use __is_nothrow_destructible (#95766) [libc++] Remove Windows-specific configuration from libcxx/test/CMakeLists.txt (#96330) [libc++] Build with -fsized-deallocation (#96217) [libc++] <experimental/simd> Add swap functions of simd reference (#86478) [libc++] Fix deployment target Lit features (#94791) [libc++] Workaround clang bug in __has_unique_object_representations (#95314) [libc++] Remove <ostream> include from <chrono> (#96035) [libc++] Fix triviality of std::pair for trivially copyable types without an assignment operator (#95444) [libc++] Install Python packaging to resolve LLDB data formatter issues (#95971) [libc++] Properly define _LIBCPP_HAS_NO_UNICODE in __config_site (#95138) [libc++] Refactor<__type_traits/is_swappable.h> (#86822) [libc++] Enable modernize-use-equals-delete (#93293) [libc++] Test suite adjustments on macOS (#95835) [libc++] Guard transitive include of `<locale>` with availability macro (#95686) [libc++] Mark more types as trivially relocatable (#89724) [libcxx] [ci] Simplify the mingw x86_64 configs (#95609) [libc++][TZDB] Disables a failing test. (#95659) [libc++] Add default copy ctor to "__chrono/exception.h" (#95338) [libcxx][test][AIX] address more platform differences in locale tests (#94826) [libc++] Remove unnecessary #ifdef guards around PSTL implementation details (#95268) [libc++] Mark local_time test as a long test (#95170) Update actions-runner version for libc++ builder images [libc++] Move the implementation of CPU-based basis operations to namespace __pstl (#95267) [libc++][modules] Mark as implemented. (#90091) [libc++] Adds __cpp_lib_three_way_comparison FTM. (#91515) [libc++] Overhaul the PSTL dispatching mechanism (#88131) [libcxx] Correct and clean-up filesystem operations error_code paths (#88341) [libc++][z/OS] Disable portion of formatter.char.funsigned-char.pass.cpp for no unicode (#94044) [libc++] Mark a few functions in the dylib as noexcept (#94098) [libc++] Fix UB in filesystem::__copy for non-existent destination. (#87615) [libc++] Simplify the definition of string::operator== (#95000) [libc++] Update with LWG issue number for shared-ptr constructor [libc++] Tweak how we check constraints on shared_ptr(nullptr_t) (#94996) [HWASan] make get_info.local_time.pass.cpp UNSUPPORTED [libc++] Fix endianness for algorithm mismatch (#93082) [HWASan] skip libcxx test that times out with hwasan [libc++][TZDB] Implements zoned_traits. (#91059) [libc++][test] Avoid `-Wunused-variable` warnings in mutex tests (#94907) [libc++] Fix invalid escape sequences in Python comments (#94032) [libc++][TZDB] Implements time_zone::to_local. (#91003) [libc++][TZDB] Implements time_zone::to_sys. (#90901) [libc++][TZDB] Implements time_zone::to_sys. (#90394) [libc++][TZDB] Implements time_zone get_info(local_time). (#89537) [libc++] Undeprecate shared_ptr atomic access APIs (#92920) [libc++][regex] Correctly adjust match prefix for zero-length matches. (#94550) [libc++][test][AIX] Only XFAIL atomic tests for before clang 19 (#94646) [libc++] Fix naming of value template parameters (#76888) [libc++][hardening] Finish documenting hardening. (#92021) Fix detection of __datasizeof with Clang. (#94174) [libc++] Fix SyntaxWarning messages from python 3.12 (#93637) [libc++] [test] Consistently use `REQUIRES: has-unix-headers` (#94122) [libc++] Add missing noexcept to span constructor (#94381) Remove act from builder image. It never turned out to be useful [libc++] Adjust XFAIL for quick_exit (#94274) [libc++] Properly detect whether C++20 modules are supported by the compiler (#94275) [libc++] Handle 0 size case for testing support operator new (#93834) [libc++] Fix regression about parsing leading decimal points (#93989) [libc++][test] Mark `optional` test functions as `TEST_CONSTEXPR_CXX20` (#94172) [clang][Modules] Remove unnecessary includes of `Module.h` (#93417) [libc++] Don't give functions C linkage (#94102) [libc++] [test] Cleanup compile-only tests (#94121) [libc++] [test] Fix `__has_include` usage, expand condvarany and spaceship coverage (#94120) [libc++] Fix `std::atomic::wait` ulock wait UL_COMPARE_AND_WAIT64 (#92783) Fix order of include flags for the target & regular include paths. (#93547) [libc++] Fix failures with GCC 14 (#92663) [libc++] Remove the inline namespace for std::filesystem in ABIv2 (#92971) [runtimes] Correctly apply libdir subdir for multilib (#93354) [clang] Preserve Qualifiers and type sugar in TemplateNames (#93433) [libc++][test] Close LWG3018 and add tests (#93047) [runtimes][CMake] Simplify the propagation of test dependencies (#93558) [runtimes] Reintroduce a way to select the compiler used for the test suite (#93542) [libc++] Make the __availability header a sub-header of __config (#93083) [libc++][test] Close LWG3238 and add tests (#93043) [libc++] LWG3223 Broken requirements for shared_ptr converting constructors (#93071) [libc++][test] Close LWG3382 and add tests (#93039) [libc++] [test] Fix portability issues for MSVC (#93259) [libc++] [test] Fix MSVC warnings (#93257) [libc++] Mark P2845R8 `__cpp_lib_format_path` and P2587R3 `__cpp_lib_to_string` as C++26 (#93255) [libc++] Split up ABI and platform configuration to their own headers (#90863) [libc++][pstl] Merge all frontend functions for the PSTL (#89219) [libcxx][test][AIX] Fix the thousands_sep expectation for fr_FR locales (#92312) [libcxx] [test] Use `shlex.quote()` to fix Python 3.13 compatibility (#93376) [libc++] Remove libcxx/include/libcxx.imp Revise IDE folder structure (#89755) [libc++][test] Close LWG3045 (#93053) [libc++] Remove a few unused includes of trivially_copyable.h (#93200) [test][libcxx] Update deallocation after #90373 (#93145) [libc++] Refactor tests for std::condition_variable (#91530) Removed redundant template in '__delete_node()' member function of '__forward_list_base' and '__list_imp' classes. (#84323) [libc++][pstl] Improve exception handling (#88998) [WebAssembly] Upstream misc. EH changes (#92990) [libc++] <experimental/simd> Add copy functions for class simd/simd_mask (#78935) [libc++][vector] Inline remaining constructors filling vector with the same value (#82068) Reland "[clang] Enable sized deallocation by default in C++14 onwards" (#90373) [libc++] Implement C++20 atomic_ref (#76647) [libc++] Refactor flaky tests for std::shared_lock (#91779) [libcxx] [test] Detect mingw-w64 headers compatible with C++ module builds (#92893) [libc++] LWG2381: Inconsistency in parsing floating point numbers (#77948) [libcxx] removes unnecessary traits from `has_unique_object_representations` (#69241) [libc++][z/OS] Switch to use TEST_HAS_NO_INT128 as per comment in PR 92261 (#92434) [libcxx] Add cast to avoid pointer casting warning on Windows (#92738) [libcxx] locale.cpp: Move build_name helper into unnamed namespace (#92461) [libcxx][libcxxabi] Fix build for OpenBSD (#92186) [libc++] LWG3672: `common_iterator::operator->()` should return by value (#87899) [libc++][z/OS] Correct a definition of __native_vector_size (#91995) [libc++][z/OS] Fixup two linear_congruential_engine tests (#92261) [libc++][test] `__cpp_lib_within_lifetime` -> `__cpp_lib_is_within_lifetime` (#91896) Fix typo "indicies" (#92232) [libcxx][test] Fix numpunct grouping tests on AIX (#91781) [libcxx] [test] Fix the locale ctype widen tests on AIX (#91744) [libc++] Vectorize std::mismatch with trivially equality comparable types (#87716) [libc++] Make `constexpr std::variant`. Implement P2231R1 (#83335) [libc++][doc] Updates Spaceship status page. [libc++][ASan] Fix std::basic_string trait type (#91590) [libc++][test] Fixes constexpr char_traits. (#90981) [libc++][functional] P2944R3 (partial): Comparisons for `reference_wrapper` (`reference_wrapper` operators only) (#88384) [libc++][CI] Reenables clang-tidy. (#90077) [libc++] Implement std::gcd using the binary version (#77747) [ASan][libc++] Turn on ASan annotations for short strings (#79536) [AIX][libc++] Enable clang_modules_include.gen.py tests (#90971) [libc++] Rename _LIBCPP_INTRODUCED_foo_MARKUP to _LIBCPP_INTRODUCED_foo_ATTRIBUTE (#91269) [libc++] Fix P1206R7 feature test macros (#90914) [libc++] Adjust some of the [rand.dist] critical values that are too strict (#88669) [libc++][modules] Uses _LIBCPP_USING_IF_EXISTS. (#90409) Bump actions runner image used for libc++'s builders. [libcxx] Align `__recommend() + 1` by __endian_factor (#90292) [libc++] Granularize <ostream> (#85537) [libc++] Remove a few __has_foo defines in __config (#90511) [libc++] Remove _LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS (#90512) [libcxx][ci] In picolib build, ask clang for the normalised triple (#90722) [libc++][ranges] Implement LWG4053 and LWG4054 (#88612) [libc++] Some tests are missing include for `numeric_limits` (#90345) [libc++] Mark scoped_lock and unique_lock constructors as [[nodiscard]] (#89397) [libc++] Improve libc++ tests when using optimizations (#88897) [libc++][modules] Enable installation by default. (#90094) [libc++][format] Improves escaping performance. (#88533) [libcxx] Remove empty ~__no_destroy (#89882) [libc++][ranges] Exports operator|. (#90071) [C++17] Support __GCC_[CON|DE]STRUCTIVE_SIZE (#89446) [libc++][ranges] LWG3984: ranges::to's recursion branch may be ill-formed (#87964) [clang] Enable sized deallocation by default in C++14 onwards (#83774) [libc++][format] Improves escaping. (#88283) [libc++] Implement LWG4023 (#87513) [libc++] Reformulate availability in terms of LLVM releases (#87563) [libc++] Reorganize the std::variant macros (#89419) [libc++][format] Adds an escaped output benchmark. (#88020) [libc++] Makes saturation functions privately available. (#89503) [libcxx] [modules] Add _LIBCPP_USING_IF_EXISTS on aligned_alloc (#89827) [libc++][TZDB] Fixes reverse time lookups. (#89502) [libc++][doc] Updates module build instructions. (#89413) [libc++][chrono] Fixes format output of negative values. (#89408) [libc++][ranges] export `std::ranges::range_adaptor_closure` (#89793) [libc++][ranges] P2387R3: Pipe support for user-defined range adaptors (#89148) [libc++] Add some private headers to libcxx.imp (#89568) [libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests (#87094) [libc++] Remove stray CMake install step for modulemap file (#89394) [libc++] Don't commit libcxx.imp (#89391) [libc++] Removes a Clang 16 Windows workaround. (#88560) [libc++][TZDB] Renames incomplete. (#89250) [libc++] Optimize char_traits a bit (#72799) [libc++] Fix usage of 'exclude_from_explicit_instantiation' attribute on local class members (#89377) linear_congruential_engine: add using more precision to prevent overflow (#81583) CompilerRT: Normalize COMPILER_RT_DEFAULT_TARGET_TRIPLE (#89234) [libc++][TZDB] Adds local_info formatter. (#86256) [libc++][pstl] Move the CPU algorithm implementations to __pstl (#89109) [libc++][TZDB] Adds sys_info formatter. (#85896) [libc++][pstl] Promote CPU backends to top-level backends (#88968) [libc++][chrono] Improves date formatting. (#86127) [libc++] Add missing iterator requirement checks in the PSTL (#88127) [libc++][TZDB] Improves time zone format specifiers. (#85797) [libc++][chrono] Disables a test. [libc++][doc] Documents -DLIBCXX_INSTALL_MODULES=ON. (#88547) [libc++][test] Removes Clang 16 validation. (#88558) [libc++] Removes deprecated _LIBCPP_ENABLE_<VERSION>_REMOVED_FEATURES macros (#88548) [libc++][modules] Removes some validation quirks. (#88031) [libc++] Deprecate the C++20 synchronization library before C++20 (#86410) [libc++] Use availability to rely on key functions for bad_expected_access and bad_function_call (#87390) [libc++] Rename __cpu_traits functions (#88741) [libc++][CI] Tests LLDB libc++ data formatters. (#88312) [libc++] Add a utility to check whether a range is valid (#87665) [libc++][PSTL] Introduce cpu traits (#88134) [libc++][RFC] Only include what is required by-version in the umbrella headers (#83740) [libc++] Deprecated `shared_ptr` Atomic Access APIs as per P0718R2 & Implemented P2869R3: Remove Deprecated `shared_ptr` Atomic Access APIs from C++26 (#87111) [libc++][TZDB] Removes test_indian_kerguelen test. [libc++][TZDZ] Validates the database version. [libc++] Undeprecate POSIX STREAM macros. (#88296) [libc++] Marks a variable const. (#88562) [libc++][CMake] Removes LIBCXX_ENABLE_CLANG_TIDY. (#85794) [tzdb] Replace shared_mutex with mutex. (#87929) [libc++] P3029R1: Better `mdspan`'s CTAD (#87873) [libc++][ranges] LWG3736: move_iterator missing disable_sized_sentinel_for specialization (#85611) [libc++] LWG3643: Missing `constexpr` in `std::counted_iterator` (#87901) [libcxx] applies changes regarding post-commit feedback to #75259 (#76534) [libc++] Fix -Wgnu-include-next in stddef.h (#88214) [libcxx] Use generic builtins for popcount, clz and ctz (#86563) [libc++] Adds a global private constructor tag. (#87920) [libc++] Removes Clang-16 support. (#87810) [lib++][CI] Changes bootstrap build type. (#88175) [libc++][CI] Updates Docker LLDB dependencies. (#88174) [libc++][chrono] Adds the sys_info class. (#85619) [libc++][format] Switches to Unicode 15.1. (#86543) [libc++] Avoids using ENODATA. (#86165) [libc++][TZDB] Fixes relative path resolving. (#87882) [libc++][format] adds a basic fuzzer test. (#87883) [libc++] Add test coverage for our implementation of LWG4031 (#87508) [libc++] Implement `bind_back` (#81055) [libc++][format] Fixed `println.blank_line.sh.cpp` test on llvm-clang-win-x-* configurations (#88011) [libc++][doc] Updates format status page. [libc++][format] P3142R0: Printing Blank Lines with `println` (#87277) [libc++] Optimize ranges::minmax (#87335) [libc++] Implement LWG3430 disallow implicit conversion of the source arguments to `std::filesystem::path` when constructing `std::basic_*fstream` (#85079) [libc++] P2872R3: Remove ``wstring_convert`` From C++26 (#87100) Fix issue with never-constexpr __construct_at in C++ < 20. (#87403) [libcxx] coerce formatter precision to int (#87738) [libc++][CI] Updates to Clang 19. (#85301) [libc++][chrono] Completes the tzdb class. (#82157) [libc++][oss-fuzz] Updates C++ version used. (#87531) [libc++] P2867R1: Remove Deprecated `strstream`s From C++26 (#87107) [libc++] Fix copy/pasta error in atomic tests for `atomic_compare_exchange_{weak,strong}` (#87135) [libc++] Mark some recent LWG issues and papers as done (#87502) [libc++][chrono] Loads leap-seconds.list in tzdb. (#82113) [libc++] Disables -Wweak-vtables diagnostics. (#85577) [libc++] Update status page after the Tokyo meeting (#87395) [libc++] Upstream ptrauth support in libc++ and libc++abi (#84573) [libc++] Fix tests on musl (#85085) (#86934) [libc++] Add a static_assert for a Mandates in seed_seq (#86992) [libc++][ranges] Avoid using `distance` in `ranges::contains_subrange` (#87155) [libc++] `std::ranges::advance`: avoid unneeded bounds checks when advancing iterator (#84126) ``` {% endcut %} commit_hash:45feb9db5b173f12bf29de2a3ee73006d4371a4e
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/regex')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/regex65
1 files changed, 38 insertions, 27 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/regex b/contrib/libs/cxxsupp/libcxx/include/regex
index dc3db93744b..b8141351213 100644
--- a/contrib/libs/cxxsupp/libcxx/include/regex
+++ b/contrib/libs/cxxsupp/libcxx/include/regex
@@ -792,7 +792,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <__algorithm/find.h>
#include <__algorithm/search.h>
#include <__assert>
-#include <__availability>
#include <__config>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/default_sentinel.h>
@@ -1346,13 +1345,12 @@ struct __state {
template <class _CharT>
class __node {
- __node(const __node&);
- __node& operator=(const __node&);
-
public:
typedef std::__state<_CharT> __state;
_LIBCPP_HIDE_FROM_ABI __node() {}
+ __node(const __node&) = delete;
+ __node& operator=(const __node&) = delete;
_LIBCPP_HIDE_FROM_ABI_VIRTUAL
virtual ~__node() {}
@@ -1953,14 +1951,14 @@ class __match_char : public __owns_one_state<_CharT> {
_CharT __c_;
- __match_char(const __match_char&);
- __match_char& operator=(const __match_char&);
-
public:
typedef std::__state<_CharT> __state;
_LIBCPP_HIDE_FROM_ABI __match_char(_CharT __c, __node<_CharT>* __s) : base(__s), __c_(__c) {}
+ __match_char(const __match_char&) = delete;
+ __match_char& operator=(const __match_char&) = delete;
+
_LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
@@ -1985,15 +1983,15 @@ class __match_char_icase : public __owns_one_state<_CharT> {
_Traits __traits_;
_CharT __c_;
- __match_char_icase(const __match_char_icase&);
- __match_char_icase& operator=(const __match_char_icase&);
-
public:
typedef std::__state<_CharT> __state;
_LIBCPP_HIDE_FROM_ABI __match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
: base(__s), __traits_(__traits), __c_(__traits.translate_nocase(__c)) {}
+ __match_char_icase(const __match_char_icase&) = delete;
+ __match_char_icase& operator=(const __match_char_icase&) = delete;
+
_LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
@@ -2018,15 +2016,15 @@ class __match_char_collate : public __owns_one_state<_CharT> {
_Traits __traits_;
_CharT __c_;
- __match_char_collate(const __match_char_collate&);
- __match_char_collate& operator=(const __match_char_collate&);
-
public:
typedef std::__state<_CharT> __state;
_LIBCPP_HIDE_FROM_ABI __match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
: base(__s), __traits_(__traits), __c_(__traits.translate(__c)) {}
+ __match_char_collate(const __match_char_collate&) = delete;
+ __match_char_collate& operator=(const __match_char_collate&) = delete;
+
_LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
@@ -2062,9 +2060,6 @@ class __bracket_expression : public __owns_one_state<_CharT> {
bool __collate_;
bool __might_have_digraph_;
- __bracket_expression(const __bracket_expression&);
- __bracket_expression& operator=(const __bracket_expression&);
-
public:
typedef std::__state<_CharT> __state;
@@ -2079,6 +2074,9 @@ public:
__collate_(__collate),
__might_have_digraph_(__traits_.getloc().name() != "C") {}
+ __bracket_expression(const __bracket_expression&) = delete;
+ __bracket_expression& operator=(const __bracket_expression&) = delete;
+
_LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
_LIBCPP_HIDE_FROM_ABI bool __negated() const { return __negate_; }
@@ -2700,9 +2698,6 @@ class __lookahead : public __owns_one_state<_CharT> {
unsigned __mexp_;
bool __invert_;
- __lookahead(const __lookahead&);
- __lookahead& operator=(const __lookahead&);
-
public:
typedef std::__state<_CharT> __state;
@@ -2710,6 +2705,9 @@ public:
__lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s, unsigned __mexp)
: base(__s), __exp_(__exp), __mexp_(__mexp), __invert_(__invert) {}
+ __lookahead(const __lookahead&) = delete;
+ __lookahead& operator=(const __lookahead&) = delete;
+
_LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const;
};
@@ -4215,11 +4213,7 @@ public:
_LIBCPP_HIDE_FROM_ABI int compare(const string_type& __s) const { return str().compare(__s); }
_LIBCPP_HIDE_FROM_ABI int compare(const value_type* __s) const { return str().compare(__s); }
- _LIBCPP_HIDE_FROM_ABI void swap(sub_match& __s)
-#ifndef _LIBCPP_CXX03_LANG
- _NOEXCEPT(__is_nothrow_swappable<_BidirectionalIterator>::value)
-#endif // _LIBCPP_CXX03_LANG
- {
+ _LIBCPP_HIDE_FROM_ABI void swap(sub_match& __s) _NOEXCEPT_(__is_nothrow_swappable_v<_BidirectionalIterator>) {
this->pair<_BidirectionalIterator, _BidirectionalIterator>::swap(__s);
std::swap(matched, __s.matched);
}
@@ -4583,7 +4577,7 @@ public:
// size:
_LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __matches_.size(); }
_LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT { return __matches_.max_size(); }
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }
+ _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }
// element access:
_LIBCPP_HIDE_FROM_ABI difference_type length(size_type __sub = 0) const {
@@ -4701,6 +4695,9 @@ private:
template <class, class>
friend class __lookahead;
+
+ template <class, class, class>
+ friend class regex_iterator;
};
template <class _BidirectionalIterator, class _Allocator>
@@ -5411,7 +5408,9 @@ template <class _BidirectionalIterator, class _CharT, class _Traits>
regex_iterator<_BidirectionalIterator, _CharT, _Traits>&
regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++() {
__flags_ |= regex_constants::__no_update_pos;
- _BidirectionalIterator __start = __match_[0].second;
+ _BidirectionalIterator __start = __match_[0].second;
+ _BidirectionalIterator __prefix_start = __start;
+
if (__match_[0].first == __match_[0].second) {
if (__start == __end_) {
__match_ = value_type();
@@ -5425,9 +5424,21 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++() {
else
++__start;
}
+
__flags_ |= regex_constants::match_prev_avail;
- if (!std::regex_search(__start, __end_, __match_, *__pregex_, __flags_))
+ if (!std::regex_search(__start, __end_, __match_, *__pregex_, __flags_)) {
__match_ = value_type();
+
+ } else {
+ // The Standard mandates that if `regex_search` returns true ([re.regiter.incr]), "`match.prefix().first` shall be
+ // equal to the previous value of `match[0].second`... It is unspecified how the implementation makes these
+ // adjustments." The adjustment is necessary if we incremented `__start` above (the branch that deals with
+ // zero-length matches).
+ auto& __prefix = __match_.__prefix_;
+ __prefix.first = __prefix_start;
+ __prefix.matched = __prefix.first != __prefix.second;
+ }
+
return *this;
}