diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-13 19:25:57 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-13 19:25:57 +0000 |
| commit | 289ae9e3ac13cefd468cfb852e8b9f52e984de08 (patch) | |
| tree | bdee1fefb7c19e3c949b2eadeecc371c8fbce48b /test/std/re | |
| parent | 9d043122e0fc90510de06d43da8eda827464c1da (diff) | |
Notes
Diffstat (limited to 'test/std/re')
| -rw-r--r-- | test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp b/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp index f3b57f6bc9da..5e3ad4d910e7 100644 --- a/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp +++ b/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp @@ -95,4 +95,22 @@ int main() assert((*i2).position() == 0); assert((*i2).str() == "555-1234"); } + { // http://llvm.org/PR33681 + std::regex rex(".*"); + const char foo[] = "foo"; + // The -1 is because we don't want the implicit null from the array. + std::cregex_iterator i(std::begin(foo), std::end(foo) - 1, rex); + std::cregex_iterator e; + assert(i != e); + assert((*i).size() == 1); + assert((*i).str() == "foo"); + + ++i; + assert(i != e); + assert((*i).size() == 1); + assert((*i).str() == ""); + + ++i; + assert(i == e); + } } |
