1 //===------------------------ stdexcept.cpp -------------------------------===// 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 "stdexcept" 10 #include "new" 11 #include <cstdlib> 12 #include <cstring> 13 #include <cstdint> 14 #include <cstddef> 15 16 // This includes an implementation file from libc++. 17 #include "src/include/refstring.h" 18 19 static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), ""); 20 21 namespace std // purposefully not using versioning namespace 22 { 23 24 logic_error::~logic_error() noexcept {} 25 26 const char* 27 logic_error::what() const noexcept 28 { 29 return __imp_.c_str(); 30 } 31 32 runtime_error::~runtime_error() noexcept {} 33 34 const char* 35 runtime_error::what() const noexcept 36 { 37 return __imp_.c_str(); 38 } 39 40 domain_error::~domain_error() noexcept {} 41 invalid_argument::~invalid_argument() noexcept {} 42 length_error::~length_error() noexcept {} 43 out_of_range::~out_of_range() noexcept {} 44 45 range_error::~range_error() noexcept {} 46 overflow_error::~overflow_error() noexcept {} 47 underflow_error::~underflow_error() noexcept {} 48 49 } // std 50