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 // iostate exceptions() const;
19 #include "test_macros.h"
21 struct testbuf
: public std::streambuf
{};
27 assert(ios
.exceptions() == std::ios::goodbit
);
28 ios
.exceptions(std::ios::eofbit
);
29 assert(ios
.exceptions() == std::ios::eofbit
);
30 #ifndef TEST_HAS_NO_EXCEPTIONS
33 ios
.exceptions(std::ios::badbit
);
36 catch (std::ios::failure
&)
39 assert(ios
.exceptions() == std::ios::badbit
);
45 assert(ios
.exceptions() == std::ios::goodbit
);
46 ios
.exceptions(std::ios::eofbit
);
47 assert(ios
.exceptions() == std::ios::eofbit
);
48 ios
.exceptions(std::ios::badbit
);
49 assert(ios
.exceptions() == std::ios::badbit
);