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 //===----------------------------------------------------------------------===//
9 // REQUIRES: c++03 || c++11 || c++14
11 // test set_unexpected
17 #include "test_macros.h"
29 std::unexpected_handler old
= std::set_unexpected(f1
);
30 // verify there is a previous unexpected handler
32 // verify f1 was replace with f2
33 assert(std::set_unexpected(f2
) == f1
);
34 // verify calling original unexpected handler calls terminate
35 std::set_terminate(f3
);