diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-12-27 22:18:08 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-12-27 22:18:08 +0000 |
commit | ecba3566861996cee8635e4c98b0fc4154e64659 (patch) | |
tree | 645c1fd77c89183510d9e77d2460ea3237acee4e /libstdc++-v3/include/bits/regex.h | |
parent | 8afe2df012564c108406069fea473c02463db6fb (diff) | |
download | gcc-ecba3566861996cee8635e4c98b0fc4154e64659.tar.gz |
PR libstdc++/83600 fix end iterator for unready std::match_results
PR libstdc++/83600
* include/bits/regex.h (match_results::end()): Return valid iterator
when not ready.
* testsuite/28_regex/match_results/ctors/char/default.cc: Check that
unready objects are empty and have equal begin and end iterators.
* testsuite/28_regex/match_results/ctors/wchar_t/default.cc: Likewise.
From-SVN: r256014
Diffstat (limited to 'libstdc++-v3/include/bits/regex.h')
-rw-r--r-- | libstdc++-v3/include/bits/regex.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h index 0d97d535e2a..d85be41f830 100644 --- a/libstdc++-v3/include/bits/regex.h +++ b/libstdc++-v3/include/bits/regex.h @@ -1749,7 +1749,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 */ const_iterator end() const - { return _Base_type::end() - 3; } + { return _Base_type::end() - (empty() ? 0 : 3); } /** * @brief Gets an iterator to one-past-the-end of the collection. |