diff options
author | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-19 23:00:13 +0000 |
---|---|---|
committer | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-19 23:00:13 +0000 |
commit | adbb1edd08f6057f674f143b4501f50f46406bef (patch) | |
tree | bb52ff3db7595623a6812207d0f1160673585f9e /libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc | |
parent | ef4ea6b76051c96c125266536ed1486b0283f74d (diff) | |
download | gcc-adbb1edd08f6057f674f143b4501f50f46406bef.tar.gz |
PR libstdc++/64649
* include/bits/regex.tcc (regex_traits<>::lookup_collatename,
regex_traits<>::lookup_classname): Support forward iterators.
* testsuite/28_regex/traits/char/lookup_classname.cc: New testcases.
* testsuite/28_regex/traits/char/lookup_collatename.cc: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc')
-rw-r--r-- | libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc b/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc index 56d0576140e..fac4a240a9b 100644 --- a/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc +++ b/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc @@ -26,6 +26,7 @@ // 28.7 (8) Class template regex_traits [re.traits] #include <regex> +#include <forward_list> #include <testsuite_hooks.h> void @@ -40,8 +41,19 @@ test01() VERIFY(t.lookup_collatename(name, name+sizeof(name)-1) == "~"); } +// Test forward iterator. +void +test02() +{ + const char strlit[] = "tilde"; + std::forward_list<char> s(strlit, strlit + strlen(strlit)); + std::regex_traits<char> traits; + VERIFY(traits.lookup_collatename(s.begin(), s.end()) == "~"); +} + int main() { test01(); + test02(); return 0; } |