regex.h (regex_iterator::regex_iterator()): Define end() as _M_pregex == nullptr.
authorTim Shen <timshen@google.com>
Wed, 9 Nov 2016 22:11:32 +0000 (22:11 +0000)
committerTim Shen <timshen@gcc.gnu.org>
Wed, 9 Nov 2016 22:11:32 +0000 (22:11 +0000)
commit7ce69e5a7156b6ada7064e6b4e75da82d582982a
tree0e81d112ff6e0f52f5581c22bc26db396d352b6d
parent39de19551b6b39d83ad791a39c72ec51f958b48b
regex.h (regex_iterator::regex_iterator()): Define end() as _M_pregex == nullptr.

* libstdc++-v3/include/bits/regex.h (regex_iterator::regex_iterator()):
Define end() as _M_pregex == nullptr.
* libstdc++-v3/include/bits/regex.tcc (regex_iterator::operator==(),
regex_iterator::operator++()): Fix operator==() and operator++() to
look at null-ness of _M_pregex on both sides.
* testsuite/28_regex/regression.cc: New testcase.

From-SVN: r242025
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/regex.h
libstdc++-v3/include/bits/regex.tcc
libstdc++-v3/testsuite/28_regex/regression.cc