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 clear(iostate state = goodbit);
21 struct testbuf : public std::streambuf {};
28 assert(ios.rdstate() == std::ios::badbit);
31 ios.exceptions(std::ios::badbit);
41 catch (std::ios::failure&)
43 assert(ios.rdstate() == std::ios::badbit);
47 ios.clear(std::ios::eofbit);
50 catch (std::ios::failure&)
52 assert(ios.rdstate() == (std::ios::eofbit | std::ios::badbit));
59 assert(ios.rdstate() == std::ios::goodbit);
60 ios.exceptions(std::ios::badbit);
62 assert(ios.rdstate() == std::ios::goodbit);
63 ios.clear(std::ios::eofbit);
64 assert(ios.rdstate() == std::ios::eofbit);