1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // template <class charT, class traits> class basic_ios
13 // void set_rdbuf(basic_streambuf<charT, traits>* sb);
19 #include "test_macros.h"
22 : public std::streambuf
29 testios(std::streambuf
* p
) : std::ios(p
) {}
30 void set_rdbuf(std::streambuf
* x
) {std::ios::set_rdbuf(x
);}
38 #ifndef TEST_HAS_NO_EXCEPTIONS
41 ios
.setstate(std::ios::badbit
);
42 ios
.exceptions(std::ios::badbit
);
50 assert(ios
.rdbuf() == &sb2
);
51 #ifndef TEST_HAS_NO_EXCEPTIONS
54 ios
.setstate(std::ios::badbit
);
55 ios
.exceptions(std::ios::badbit
);
62 assert(ios
.rdbuf() == 0);