1 //===------------------------ stdexcept.cpp -------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "__refstring"
14 #include "system_error"
17 #define __has_include(inc) 0
20 /* For _LIBCPPABI_VERSION */
21 #if __has_include(<cxxabi.h>) || defined(__APPLE_) || defined(LIBCXXRT)
25 static_assert(sizeof(std::__libcpp_refstring
) == sizeof(const char *), "");
27 namespace std
// purposefully not using versioning namespace
30 logic_error::logic_error(const string
& msg
) : __imp_(msg
.c_str())
34 logic_error::logic_error(const char* msg
) : __imp_(msg
)
38 logic_error::logic_error(const logic_error
& le
) _NOEXCEPT
: __imp_(le
.__imp_
)
43 logic_error::operator=(const logic_error
& le
) _NOEXCEPT
49 #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
51 logic_error::~logic_error() _NOEXCEPT
56 logic_error::what() const _NOEXCEPT
58 return __imp_
.c_str();
63 runtime_error::runtime_error(const string
& msg
) : __imp_(msg
.c_str())
67 runtime_error::runtime_error(const char* msg
) : __imp_(msg
)
71 runtime_error::runtime_error(const runtime_error
& le
) _NOEXCEPT
77 runtime_error::operator=(const runtime_error
& le
) _NOEXCEPT
83 #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
85 runtime_error::~runtime_error() _NOEXCEPT
90 runtime_error::what() const _NOEXCEPT
92 return __imp_
.c_str();
95 domain_error::~domain_error() _NOEXCEPT
{}
96 invalid_argument::~invalid_argument() _NOEXCEPT
{}
97 length_error::~length_error() _NOEXCEPT
{}
98 out_of_range::~out_of_range() _NOEXCEPT
{}
100 range_error::~range_error() _NOEXCEPT
{}
101 overflow_error::~overflow_error() _NOEXCEPT
{}
102 underflow_error::~underflow_error() _NOEXCEPT
{}