1349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 9*c9157d92SDimitry Andric #include <__verbose_abort> 1081ad6265SDimitry Andric #include <new> 1181ad6265SDimitry Andric #include <stdexcept> 1281ad6265SDimitry Andric #include <string> 130b57cec5SDimitry Andric 140b57cec5SDimitry Andric #ifdef _LIBCPP_ABI_VCRUNTIME 150b57cec5SDimitry Andric # include "support/runtime/stdexcept_vcruntime.ipp" 160b57cec5SDimitry Andric #else 170b57cec5SDimitry Andric # include "support/runtime/stdexcept_default.ipp" 180b57cec5SDimitry Andric #endif 19*c9157d92SDimitry Andric 20*c9157d92SDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD 21*c9157d92SDimitry Andric __throw_runtime_error(const char * msg)22*c9157d92SDimitry Andric_LIBCPP_NORETURN void __throw_runtime_error(const char* msg) { 23*c9157d92SDimitry Andric #ifndef _LIBCPP_HAS_NO_EXCEPTIONS 24*c9157d92SDimitry Andric throw runtime_error(msg); 25*c9157d92SDimitry Andric #else 26*c9157d92SDimitry Andric _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode with message \"%s\"", msg); 27*c9157d92SDimitry Andric #endif 28*c9157d92SDimitry Andric } 29*c9157d92SDimitry Andric 30*c9157d92SDimitry Andric _LIBCPP_END_NAMESPACE_STD 31