| 1 | #include <locale> |
| 2 | #include <assert.h> |
| 3 | |
| 4 | void |
| 5 | test_pr37475() |
| 6 | { |
| 7 | typedef std::codecvt<wchar_t, char, std::mbstate_t> test_type; |
| 8 | const test_type& cvt = std::use_facet<test_type>(std::locale::classic()); |
| 9 | const wchar_t from = L'a'; |
| 10 | const wchar_t* from_next; |
| 11 | char to; |
| 12 | char* to_next; |
| 13 | std::mbstate_t st = std::mbstate_t(); |
| 14 | std::codecvt_base::result res |
| 15 | = cvt.out(st, &from, &from+1, from_next, &to, &to, to_next); |
| 16 | |
| 17 | assert( res == std::codecvt_base::partial ); |
| 18 | } |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | test_pr37475(); |
| 23 | } |