llvm-project/libcxx/src/exception.cpp
A. Jiang 4ea2c73886
[libc++] Deprecate and remove std::uncaught_exception (#101830)
Works towards P0619R4/#99985.

- std::uncaught_exception was not previously deprecated. This patch
  deprecates it since C++17 as per N4259. std::uncaught_exceptions is
  used instead as libc++ unconditionally provides this function.

- _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION restores
  std::uncaught_exception.

- As a drive-by, this patch updates the C++20 status page to 
  explain that D.11 is already done, since it was done in 
  578d09c1b195d859ca7e62840ff6bb83421a77b5.
2024-08-27 17:15:03 -04:00

39 lines
1.4 KiB
C++

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#define _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION
#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <exception>
#include <new>
#include <typeinfo>
#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
# include <cxxabi.h>
using namespace __cxxabiv1;
# define HAVE_DEPENDENT_EH_ABI 1
#endif
#if defined(_LIBCPP_ABI_MICROSOFT)
# include "support/runtime/exception_msvc.ipp"
# include "support/runtime/exception_pointer_msvc.ipp"
#elif defined(_LIBCPPABI_VERSION)
# include "support/runtime/exception_libcxxabi.ipp"
# include "support/runtime/exception_pointer_cxxabi.ipp"
#elif defined(LIBCXXRT)
# include "support/runtime/exception_libcxxrt.ipp"
# include "support/runtime/exception_pointer_cxxabi.ipp"
#elif defined(__GLIBCXX__)
# include "support/runtime/exception_glibcxx.ipp"
# include "support/runtime/exception_pointer_glibcxx.ipp"
#else
# include "include/atomic_support.h"
# include "support/runtime/exception_fallback.ipp"
# include "support/runtime/exception_pointer_unimplemented.ipp"
#endif