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