Add code to honor the match_not_bol and match_not_eol regex flats. Fixes PR#22651. Thanks to Jim Porter for the report and suggested fix.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2015-03-19 17:05:59 +00:00
parent 2d24d89e9b
commit 64befb5bc5
3 changed files with 104 additions and 2 deletions

View File

@@ -1947,7 +1947,8 @@ template <class _CharT>
void
__l_anchor<_CharT>::__exec(__state& __s) const
{
if (__s.__at_first_ && __s.__current_ == __s.__first_)
if (__s.__at_first_ && __s.__current_ == __s.__first_ &&
!(__s.__flags_ & regex_constants::match_not_bol))
{
__s.__do_ = __state::__accept_but_not_consume;
__s.__node_ = this->first();
@@ -1981,7 +1982,8 @@ template <class _CharT>
void
__r_anchor<_CharT>::__exec(__state& __s) const
{
if (__s.__current_ == __s.__last_)
if (__s.__current_ == __s.__last_ &&
!(__s.__flags_ & regex_constants::match_not_eol))
{
__s.__do_ = __state::__accept_but_not_consume;
__s.__node_ = this->first();