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 // <locale> 10 11 // wbuffer_convert<Codecvt, Elem, Tr> 12 13 // streambuf *rdbuf(streambuf *bytebuf); 14 15 // XFAIL: libcpp-has-no-wide-characters 16 17 #include <locale> 18 #include <codecvt> 19 #include <sstream> 20 #include <cassert> 21 22 #include "test_macros.h" 23 main(int,char **)24int main(int, char**) 25 { 26 typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B; 27 { 28 std::stringstream s; 29 B b; 30 assert(b.rdbuf() == nullptr); 31 b.rdbuf(s.rdbuf()); 32 assert(b.rdbuf() == s.rdbuf()); 33 } 34 35 return 0; 36 } 37