aboutsummaryrefslogtreecommitdiffstats
path: root/test/std/re/re.iter/re.regiter
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/re/re.iter/re.regiter')
-rw-r--r--test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp18
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);
+ }
}