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 //===----------------------------------------------------------------------===//
8 
9 // XFAIL: c++03
10 
11 // <system_error>
12 
13 // class error_code
14 
15 // explicit operator bool() const;
16 
17 #include <system_error>
18 
test_func(void)19 bool test_func(void)
20 {
21     const std::error_code ec(0, std::generic_category());
22     return ec;   // conversion to bool is explicit; should fail.
23 }
24 
main(int,char **)25 int main(int, char**)
26 {
27     return 0;
28 }
29