Marshall Clow | 62f34be | 2013-09-05 04:48:45 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <iomanip> |
| 11 | |
| 12 | // quoted |
| 13 | |
| 14 | #include <iomanip> |
| 15 | #include <sstream> |
| 16 | #include <string> |
| 17 | #include <cassert> |
| 18 | |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 19 | #if _LIBCPP_STD_VER > 11 |
Marshall Clow | 62f34be | 2013-09-05 04:48:45 +0000 | [diff] [blame] | 20 | |
| 21 | template <class charT> |
| 22 | struct test_traits |
| 23 | { |
| 24 | typedef charT char_type; |
| 25 | }; |
| 26 | |
| 27 | void round_trip ( const char *p ) { |
| 28 | std::stringstream ss; |
| 29 | ss << std::quoted(p); |
| 30 | std::basic_string<char, test_traits<char>> s; |
| 31 | ss >> std::quoted(s); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | |
| 36 | int main() |
| 37 | { |
| 38 | round_trip ( "Hi Mom" ); |
| 39 | } |
| 40 | #else |
| 41 | #error |
| 42 | #endif |