diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-11 17:25:23 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-11 17:25:23 +0000 |
commit | e375726f9c697a52cdb2a026dffeb2165937a830 (patch) | |
tree | 5e1581b4cbf051628f7453eee489702e591a173a /libstdc++-v3/testsuite/tr1 | |
parent | e0b61fdb99c1d8584889b2f61b3a5e7960272154 (diff) | |
download | gcc-e375726f9c697a52cdb2a026dffeb2165937a830.tar.gz |
* include/tr1_impl/regex (basic_regex::basic_regex): Use range
constructor for _M_pattern.
* testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/
string.cc: Test construction from different basic_string type.
* testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/
string.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143275 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/tr1')
-rw-r--r-- | libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc | 11 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc index c2fb2c7d51c..39cce6c6472 100644 --- a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc @@ -25,6 +25,7 @@ #include <string> #include <tr1/regex> #include <testsuite_hooks.h> +#include <testsuite_allocator.h> // Tests C++ string constructor of the basic_regex class. void test01() @@ -35,9 +36,19 @@ void test01() test_type re(s); } +void test02() +{ + typedef std::tr1::basic_regex<char> test_type; + typedef __gnu_test::tracker_allocator<char> alloc_type; + + std::basic_string<char, std::char_traits<char>, alloc_type> s("a*b"); + test_type re(s); +} + int main() { test01(); + test02(); return 0; }; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc index bcedd4966da..9e6a9adc9a2 100644 --- a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc @@ -25,6 +25,7 @@ #include <string> #include <tr1/regex> #include <testsuite_hooks.h> +#include <testsuite_allocator.h> // Tests C++ string constructor of the basic_regex class. void test01() @@ -35,9 +36,19 @@ void test01() test_type re(s); } +void test02() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + typedef __gnu_test::tracker_allocator<wchar_t> alloc_type; + + std::basic_string<wchar_t, std::char_traits<wchar_t>, alloc_type> s(L"a*b"); + test_type re(s); +} + int main() { test01(); + test02(); return 0; }; |