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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include <__verbose_abort>
10#include <new>
11#include <stdexcept>
12#include <string>
13
14#ifdef _LIBCPP_ABI_VCRUNTIME
15# include "support/runtime/stdexcept_vcruntime.ipp"
16#else
17# include "support/runtime/stdexcept_default.ipp"
18#endif
19
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22_LIBCPP_NORETURN void __throw_runtime_error(const char* msg) {
23#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
24 throw runtime_error(msg);
25#else
26 _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode with message \"%s\"", msg);
27#endif
28}
29
30_LIBCPP_END_NAMESPACE_STD
31

source code of libcxx/src/stdexcept.cpp