Is there any reason this object is created on the heap?
diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc index 7f89933..92ca590 100644 --- a/libstdc++-v3/include/bits/regex_executor.tcc +++ b/libstdc++-v3/include/bits/regex_executor.tcc @@ -145,13 +145,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_lookahead(_State<_TraitsT> __state) { _ResultsVec __what(_M_cur_results.size()); - auto __sub = std::unique_ptr<_Executor>(new _Executor(_M_current, - _M_end, - __what, - _M_re, - _M_flags)); - __sub->_M_start_state = __state._M_alt; - if (__sub->_M_search_from_first()) + _Executor __sub(_M_current, _M_end, __what, _M_re, _M_flags); + __sub._M_start_state = __state._M_alt; + if (__sub._M_search_from_first()) { for (size_t __i = 0; __i < __what.size(); __i++) if (__what[__i].matched)