From: Tim Shen Date: Wed, 31 Dec 2014 10:27:41 +0000 (+0000) Subject: re PR libstdc++/64441 (A match_results returns an incorrect sub_match if the sub_matc... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec5f010299aeae689871053d9f2164a9ea7f3a87;p=gcc.git re PR libstdc++/64441 (A match_results returns an incorrect sub_match if the sub_match::matched is false) PR libstdc++/64441 * include/bits/regex.tcc (__regex_algo_impl): s/auto/auto&/. * include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Likewise. From-SVN: r219121 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 59747319403..cb01af03930 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2014-12-31 Tim Shen + + PR libstdc++/64441 + * include/bits/regex.tcc (__regex_algo_impl): s/auto/auto&/. + * include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Likewise. + 2014-12-28 David Edelsohn * testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc: diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc index 0206a6cf0e1..b541446422b 100644 --- a/libstdc++-v3/include/bits/regex.tcc +++ b/libstdc++-v3/include/bits/regex.tcc @@ -96,7 +96,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } if (__ret) { - for (auto __it : __res) + for (auto& __it : __res) if (!__it.matched) __it.first = __it.second = __e; auto& __pre = __res[__res.size()-2]; diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc index a9736675bf6..7954d06eb3f 100644 --- a/libstdc++-v3/include/bits/regex_executor.tcc +++ b/libstdc++-v3/include/bits/regex_executor.tcc @@ -310,7 +310,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (!__submatch.matched) break; auto __last = _M_current; - for (auto __tmp = __submatch.first; + for (auto& __tmp = __submatch.first; __last != _M_end && __tmp != __submatch.second; ++__tmp) ++__last;