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 // UNSUPPORTED: no-exceptions
11 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION
12 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14 // test uncaught_exception
19 #include "test_macros.h"
25 assert(std::uncaught_exception());
33 // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475
34 assert(!std::uncaught_exception());
43 assert(!std::uncaught_exception());
48 assert(!std::uncaught_exception());
50 assert(!std::uncaught_exception());