| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Bug 119748 |
| 4 | // string(InputIterator, InputIterator) rejects volatile charT* as iterator |
| 5 | |
| 6 | #ifndef TEST_CHAR_TYPE |
| 7 | #define TEST_CHAR_TYPE char |
| 8 | #endif |
| 9 | |
| 10 | #include <string> |
| 11 | #include <testsuite_iterators.h> |
| 12 | |
| 13 | typedef TEST_CHAR_TYPE C; |
| 14 | |
| 15 | volatile C vs[42] = {}; |
| 16 | std::basic_string<C> s(vs+0, vs+42); |
| 17 | #ifdef __cpp_lib_containers_ranges |
| 18 | std::basic_string<C> s2(std::from_range, vs); |
| 19 | #endif |
| 20 | |
| 21 | using namespace __gnu_test; |
| 22 | |
| 23 | test_container<volatile C, input_iterator_wrapper> input_cont(vs); |
| 24 | std::basic_string<C> s3(input_cont.begin(), input_cont.end()); |
| 25 | |
| 26 | test_container<volatile C, forward_iterator_wrapper> fwd_cont(vs); |
| 27 | std::basic_string<C> s4(fwd_cont.begin(), fwd_cont.end()); |
| 28 | |
| 29 | #ifdef __cpp_lib_containers_ranges |
| 30 | test_input_range<volatile C> input_range(vs); |
| 31 | std::basic_string<C> s5(std::from_range, input_range); |
| 32 | |
| 33 | test_forward_range<volatile C> fwd_range(vs); |
| 34 | std::basic_string<C> s6(std::from_range, fwd_range); |
| 35 | #endif |