31 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9#include <__verbose_abort>10#include <new>11#include <stdexcept>12#include <string>13 14#ifdef _LIBCPP_ABI_VCRUNTIME15# include "support/runtime/stdexcept_vcruntime.ipp"16#else17# include "support/runtime/stdexcept_default.ipp"18#endif19 20_LIBCPP_BEGIN_NAMESPACE_STD21 22void __throw_runtime_error(const char* msg) {23#if _LIBCPP_HAS_EXCEPTIONS24 throw runtime_error(msg);25#else26 _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode with message \"%s\"", msg);27#endif28}29 30_LIBCPP_END_NAMESPACE_STD31