Debian Codegraph @

libcxx/test/libcxx-03/depr/exception.unexpected/unexpected.pass.cpp

raw
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 // test unexpected
10
11 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
12
13 #include <exception>
14 #include <cstdlib>
15 #include <cassert>
16
17 #include "test_macros.h"
18
19 void fexit()
20 {
21 std::exit(0);
22 }
23
24 int main(int, char**)
25 {
26 std::set_unexpected(fexit);
27 std::unexpected();
28 assert(false);
29
30 return 0;
31 }