2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPPABI_VERSION
11 #error this header can only be used with libc++abi
16 bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
18 int uncaught_exceptions() noexcept
20 # if _LIBCPPABI_VERSION > 1001
21 return __cxa_uncaught_exceptions();
23 return __cxa_uncaught_exception() ? 1 : 0;