]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/28_regex/iterators/regex_token_iterator/lwg3719.cc
1 // { dg-do run { target c++20 } }
5 #include <testsuite_hooks.h>
7 // LWG 3719. Directory iterators should be usable with default sentinel
12 std::sregex_iterator r0
;
13 VERIFY( r0
== std::default_sentinel
);
14 std::string haystack
= "a needle in a haystack";
15 std::regex
needle("needle");
16 std::sregex_iterator
r1(haystack
.begin(), haystack
.end(), needle
);
17 VERIFY( r1
!= std::default_sentinel
);
19 VERIFY( r1
== std::default_sentinel
);
21 static_assert( noexcept(r0
== std::default_sentinel
) ); // GCC extension
22 static_assert( noexcept(r0
!= std::default_sentinel
) ); // GCC extension