https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64239
--- Comment #4 from Tim Shen <timshen at gcc dot gnu.org> --- Sorry, I was once thinking that we should always use match_results::prefix().first as the "start position of a match". It's true for regex_match and regex_search, but not true for regex_iterator. That's why match_results::_M_begin exists. _M_in_iterator was just a dumb mistake that I can't even understand now, probably for my misunderstanding on the "start position of a match". Sorry :( Also, obviously I forgot to update ctor/assign/swap after adding match_results::_M_match. I'm testing the patch that fixes this. Later I'll post it in the mailing list. It removes _M_in_iterator. To backport it to 4.9 branch, _M_in_iterator needs to remain. Thanks for reporting and investigating!