commit 0ce23cc62b09071f8855ebed061b9cbddd50b70e Author: tim Date: Tue Oct 1 16:10:01 2013 -0400 2013-10-01 Tim Shen * doc/xml/manual/status_cxx2011.xml: Update regex status. * include/bits/regex.h (match_results<>::begin, match_results<>::cbegin, match_results<>::end, match_results<>::cend): [28.10.3.13], [28.10.3.14] Always iterate the range [0...size()-2]. diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2011.xml b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml index 286a539..47aaa7d 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxx2011.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml @@ -2179,31 +2179,27 @@ particular release. - 28.1 General - N + Y - 28.2 Definitions - N + Y - 28.3 Requirements - N + Y - 28.4 Header <regex> synopsis - N + Y @@ -2223,48 +2219,43 @@ particular release. 28.7 Class template regex_traits Partial + transform_primary not well defined - 28.8 Class template basic_regex - Partial + Y - 28.9 Class template sub_match - Partial + Y - 28.10 Class template match_results - Partial + Y - 28.11 Regular expression algorithms - N + Y - 28.12 Regular expression Iterators - N + Y - 28.13 Modified ECMAScript regular expression grammar - N + Y diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h index cbe9036..6d4502b 100644 --- a/libstdc++-v3/include/bits/regex.h +++ b/libstdc++-v3/include/bits/regex.h @@ -416,8 +416,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * @throws regex_error if @p __p is not a valid regular expression. */ - basic_regex(const _Ch_type* __p, - std::size_t __len, flag_type __f = ECMAScript) + basic_regex(const _Ch_type* __p, std::size_t __len, + flag_type __f = ECMAScript) : basic_regex(__p, __p + __len, __f) { } @@ -484,8 +484,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * @throws regex_error if @p __l is not a valid regular expression. */ - basic_regex(initializer_list<_Ch_type> __l, - flag_type __f = ECMAScript) + basic_regex(initializer_list<_Ch_type> __l, flag_type __f = ECMAScript) : basic_regex(__l.begin(), __l.end(), __f) { } @@ -1494,17 +1493,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @name 10.? Public Types */ //@{ - typedef _Alloc allocator_type; typedef sub_match<_Bi_iter> value_type; typedef const value_type& const_reference; typedef const_reference reference; typedef typename _Base_type::const_iterator const_iterator; typedef const_iterator iterator; typedef typename __iter_traits::difference_type difference_type; - typedef typename __iter_traits::value_type char_type; typedef typename allocator_traits<_Alloc>::size_type size_type; - - + typedef _Alloc allocator_type; + typedef typename __iter_traits::value_type char_type; typedef std::basic_string string_type; //@} @@ -1730,21 +1727,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ const_iterator cbegin() const - { return _Base_type::cbegin(); } + { return _Base_type::cbegin() + 2; } /** * @brief Gets an iterator to one-past-the-end of the collection. */ const_iterator end() const - { return !empty() ? _Base_type::end() - 2 : _Base_type::end(); } + { return _Base_type::end() - 2; } /** * @brief Gets an iterator to one-past-the-end of the collection. */ const_iterator cend() const - { return end(); } + { return _Base_type::cend(); } //@} @@ -2263,14 +2260,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template - inline basic_string<_Ch_type> + inline basic_string<_Ch_type, _St, _Sa> regex_replace(const basic_string<_Ch_type, _St, _Sa>& __s, const basic_regex<_Ch_type, _Rx_traits>& __e, const basic_string<_Ch_type, _Fst, _Fsa>& __fmt, regex_constants::match_flag_type __flags = regex_constants::match_default) { - basic_string<_Ch_type> __result; + basic_string<_Ch_type, _St, _Sa> __result; regex_replace(std::back_inserter(__result), __s.begin(), __s.end(), __e, __fmt, __flags); return __result; @@ -2289,14 +2286,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template - inline basic_string<_Ch_type> + inline basic_string<_Ch_type, _St, _Sa> regex_replace(const basic_string<_Ch_type, _St, _Sa>& __s, const basic_regex<_Ch_type, _Rx_traits>& __e, const _Ch_type* __fmt, regex_constants::match_flag_type __flags = regex_constants::match_default) { - basic_string<_Ch_type> __result; + basic_string<_Ch_type, _St, _Sa> __result; regex_replace(std::back_inserter(__result), __s.begin(), __s.end(), __e, __fmt, __flags); return __result; @@ -2662,7 +2659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_end_of_seq() { return _M_result == nullptr; } - _Position _M_position; + _Position _M_position; const value_type* _M_result; value_type _M_suffix; std::size_t _M_n;