1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // XFAIL: libcpp-no-exceptions
13 // template <class charT, class traits> class basic_ios
15 // void set_rdbuf(basic_streambuf<charT, traits>* sb);
22 : public std::streambuf
29 testios(std::streambuf* p) : std::ios(p) {}
30 void set_rdbuf(std::streambuf* x) {std::ios::set_rdbuf(x);}
40 ios.setstate(std::ios::badbit);
41 ios.exceptions(std::ios::badbit);
47 assert(ios.rdbuf() == &sb2);
50 ios.setstate(std::ios::badbit);
51 ios.exceptions(std::ios::badbit);
57 assert(ios.rdbuf() == 0);