]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR libstdc++/61424 (std::regex matches right to left, not leftmost longest)
authorTim Shen <timshen@google.com>
Tue, 1 Jul 2014 02:10:31 +0000 (02:10 +0000)
committerTim Shen <timshen@gcc.gnu.org>
Tue, 1 Jul 2014 02:10:31 +0000 (02:10 +0000)
commitad9ec7b3c5969c776bc28e18292be09981abaa6a
tree88aab4a08a668b5a2e116189f2dd62d4878258ff
parent25f28ff0ea8202215b7432f9ade8cb51b01a0185
re PR libstdc++/61424 (std::regex matches right to left, not leftmost longest)

PR libstdc++/61424
* include/bits/regex.tcc (__regex_algo_impl<>): Use DFS for ECMAScript,
not just regex containing back-references.
* include/bits/regex_compiler.tcc (_Compiler<>::_M_disjunction):
exchange _M_next and _M_alt for alternative operator,
making matching from left to right.
* include/bits/regex_executor.h (_State_info<>::_M_get_sol_pos):
Add position tracking fom DFS.
* include/bits/regex_executor.tcc (_Executor<>::_M_main_dispatch,
_Executor<>::_M_dfs): Likewise.
* include/bits/regex_scanner.h: Remove unused enum entry.
* testsuite/28_regex/algorithms/regex_search/61424.cc: New
testcase from PR.

From-SVN: r212184
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/regex.tcc
libstdc++-v3/include/bits/regex_compiler.tcc
libstdc++-v3/include/bits/regex_executor.h
libstdc++-v3/include/bits/regex_executor.tcc
libstdc++-v3/include/bits/regex_scanner.h
libstdc++-v3/testsuite/28_regex/algorithms/regex_search/61424.cc [new file with mode: 0644]