https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68863
--- Comment #4 from Tim Shen <timshen at gcc dot gnu.org> --- Author: timshen Date: Tue Dec 15 05:59:01 2015 New Revision: 231643 URL: https://gcc.gnu.org/viewcvs?rev=231643&root=gcc&view=rev Log: Backport from mainline 2015-12-15 Tim Shen <tims...@google.com> PR libstdc++/68863 * include/bits/regex_executor.tcc (_Executor::_M_lookahead): Copy the captured content for lookahead, so that the backreferences inside can refer to them. * testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc: New testcase. Added: branches/gcc-4_9-branch/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc Modified: branches/gcc-4_9-branch/libstdc++-v3/ChangeLog branches/gcc-4_9-branch/libstdc++-v3/include/bits/regex_executor.tcc