aboutsummaryrefslogtreecommitdiffstats
path: root/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-13 19:25:57 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-13 19:25:57 +0000
commit289ae9e3ac13cefd468cfb852e8b9f52e984de08 (patch)
treebdee1fefb7c19e3c949b2eadeecc371c8fbce48b /test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
parent9d043122e0fc90510de06d43da8eda827464c1da (diff)
downloadsrc-vendor/libc++/libc++-trunk-r307894.tar.gz
src-vendor/libc++/libc++-trunk-r307894.zip
Vendor import of libc++ trunk r307894:vendor/libc++/libc++-trunk-r307894
Diffstat (limited to 'test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp')
-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);
+ }
}