[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / input.output / iostreams.base / ios / iostate.flags / bool.pass.cpp
blob24fcbff39260c98bfd9928027522907a0ddec0b3
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // <ios>
11 // template <class charT, class traits> class basic_ios
13 // operator unspecified-bool-type() const;
15 #include <ios>
16 #include <type_traits>
17 #include <cassert>
19 #include "test_macros.h"
21 int main(int, char**)
23 std::ios ios(0);
24 assert(static_cast<bool>(ios) == !ios.fail());
25 ios.setstate(std::ios::failbit);
26 assert(static_cast<bool>(ios) == !ios.fail());
27 static_assert((!std::is_convertible<std::ios, void*>::value), "");
28 static_assert((!std::is_convertible<std::ios, int>::value), "");
29 static_assert((!std::is_convertible<std::ios const&, int>::value), "");
30 #if TEST_STD_VER >= 11
31 static_assert((!std::is_convertible<std::ios, bool>::value), "");
32 #endif
34 return 0;