1*61d2a9b3SPiotr Fusik //===----------------------------------------------------------------------===//
2*61d2a9b3SPiotr Fusik //
3*61d2a9b3SPiotr Fusik // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*61d2a9b3SPiotr Fusik // See https://llvm.org/LICENSE.txt for license information.
5*61d2a9b3SPiotr Fusik // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*61d2a9b3SPiotr Fusik //
7*61d2a9b3SPiotr Fusik //===----------------------------------------------------------------------===//
8*61d2a9b3SPiotr Fusik
9*61d2a9b3SPiotr Fusik // UNSUPPORTED: c++03, c++11, c++14, c++17
10*61d2a9b3SPiotr Fusik
11*61d2a9b3SPiotr Fusik // <sstream>
12*61d2a9b3SPiotr Fusik
13*61d2a9b3SPiotr Fusik // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>
14*61d2a9b3SPiotr Fusik // class basic_istringstream
15*61d2a9b3SPiotr Fusik
16*61d2a9b3SPiotr Fusik // void str(basic_string<charT, traits, Allocator>&& s);
17*61d2a9b3SPiotr Fusik
18*61d2a9b3SPiotr Fusik #include <sstream>
19*61d2a9b3SPiotr Fusik #include <cassert>
20*61d2a9b3SPiotr Fusik
21*61d2a9b3SPiotr Fusik #include "make_string.h"
22*61d2a9b3SPiotr Fusik #include "test_macros.h"
23*61d2a9b3SPiotr Fusik
24*61d2a9b3SPiotr Fusik #define STR(S) MAKE_STRING(CharT, S)
25*61d2a9b3SPiotr Fusik
26*61d2a9b3SPiotr Fusik template <class CharT>
test()27*61d2a9b3SPiotr Fusik static void test() {
28*61d2a9b3SPiotr Fusik {
29*61d2a9b3SPiotr Fusik std::basic_istringstream<CharT> ss;
30*61d2a9b3SPiotr Fusik std::basic_string<CharT> s(STR("testing"));
31*61d2a9b3SPiotr Fusik ss.str(std::move(s));
32*61d2a9b3SPiotr Fusik assert(ss.str() == STR("testing"));
33*61d2a9b3SPiotr Fusik }
34*61d2a9b3SPiotr Fusik }
35*61d2a9b3SPiotr Fusik
main(int,char **)36*61d2a9b3SPiotr Fusik int main(int, char**) {
37*61d2a9b3SPiotr Fusik test<char>();
38*61d2a9b3SPiotr Fusik #ifndef TEST_HAS_NO_WIDE_CHARACTERS
39*61d2a9b3SPiotr Fusik test<wchar_t>();
40*61d2a9b3SPiotr Fusik #endif
41*61d2a9b3SPiotr Fusik return 0;
42*61d2a9b3SPiotr Fusik }
43