xref: /llvm-project/libcxx/test/std/input.output/syncstream/osyncstream/members/rdbuf.pass.cpp (revision 7cc72a0a2ec22855572d96411febd4f2c4ac5a49)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: no-localization
11 // UNSUPPORTED: libcpp-has-no-experimental-syncstream
12 
13 // <syncstream>
14 
15 // template <class charT, class traits, class Allocator>
16 // class basic_osyncstream;
17 
18 // syncbuf_type* rdbuf() const noexcept
19 
20 #include <syncstream>
21 #include <sstream>
22 #include <cassert>
23 
24 #include "test_macros.h"
25 
26 template <class CharT>
test()27 void test() {
28   const std::basic_osyncstream<CharT> out{nullptr};
29   assert(out.rdbuf() != nullptr);
30   ASSERT_NOEXCEPT(out.rdbuf());
31 }
32 
main(int,char **)33 int main(int, char**) {
34   test<char>();
35 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
36   test<wchar_t>();
37 #endif
38 
39   return 0;
40 }
41