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 //===----------------------------------------------------------------------===//
12 // template <class charT, class traits> class basic_ios
14 // iostate exceptions() const;
20 #include "test_macros.h"
22 struct testbuf : public std::streambuf {};
28 assert(ios.exceptions() == std::ios::goodbit);
29 ios.exceptions(std::ios::eofbit);
30 assert(ios.exceptions() == std::ios::eofbit);
31 #ifndef TEST_HAS_NO_EXCEPTIONS
34 ios.exceptions(std::ios::badbit);
37 catch (std::ios::failure&)
40 assert(ios.exceptions() == std::ios::badbit);
46 assert(ios.exceptions() == std::ios::goodbit);
47 ios.exceptions(std::ios::eofbit);
48 assert(ios.exceptions() == std::ios::eofbit);
49 ios.exceptions(std::ios::badbit);
50 assert(ios.exceptions() == std::ios::badbit);