blob: bc25c0f9e6ef6258add4a5f8d9bd00f8b07e91e6 [file] [log] [blame]
Louis Dionneeb8650a2021-11-17 21:25:011//===----------------------------------------------------------------------===//
Howard Hinnant3e519522010-05-11 19:42:162//
Chandler Carruth57b08b02019-01-19 10:56:403// 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
Howard Hinnant3e519522010-05-11 19:42:166//
7//===----------------------------------------------------------------------===//
8
Louis Dionne280d68e2023-07-11 18:55:269#include <__verbose_abort>
Arthur O'Dwyerbbb0f2c2022-02-11 18:00:3910#include <new>
11#include <stdexcept>
12#include <string>
Eric Fiselier2710d8e2019-03-06 20:31:5713
14#ifdef _LIBCPP_ABI_VCRUNTIME
Louis Dionne280d68e2023-07-11 18:55:2615# include "support/runtime/stdexcept_vcruntime.ipp"
Eric Fiselier2710d8e2019-03-06 20:31:5716#else
Louis Dionne280d68e2023-07-11 18:55:2617# include "support/runtime/stdexcept_default.ipp"
Richard Smith11ffde32012-04-19 01:36:1218#endif
Louis Dionne280d68e2023-07-11 18:55:2619
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