[Patch, libstdc++/64441] Fix sub_match::first and second
Tim Shen
timshen@google.com
Wed Dec 31 06:58:00 GMT 2014
A dumb mistake :)
Bootstrapped and tested.
Thanks!
--
Regards,
Tim Shen
-------------- next part --------------
commit 7fc4b45bb9cf6b1c6ec6620092ae18fe41cb57af
Author: timshen <timshen@google.com>
Date: Tue Dec 30 21:14:48 2014 -0800
2014-12-30 Tim Shen <timshen@google.com>
PR libstdc++/64441
* include/bits/regex.tcc (__regex_algo_impl): s/auto/auto&/.
* include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Likewise.
diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc
index 0206a6c..b541446 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 a973667..7954d06 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;
More information about the Libstdc++
mailing list