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 //===----------------------------------------------------------------------===//
13 #include "system_error"
14 #include "__refstring"
16 /* For _LIBCPPABI_VERSION */
17 #if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && \
18 (defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT))
22 static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
25 namespace std // purposefully not using versioning namespace
28 logic_error::logic_error(const string& msg) : __imp_(msg.c_str())
32 logic_error::logic_error(const char* msg) : __imp_(msg)
36 logic_error::logic_error(const logic_error& le) _NOEXCEPT : __imp_(le.__imp_)
41 logic_error::operator=(const logic_error& le) _NOEXCEPT
47 #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
49 logic_error::~logic_error() _NOEXCEPT
54 logic_error::what() const _NOEXCEPT
56 return __imp_.c_str();
61 runtime_error::runtime_error(const string& msg) : __imp_(msg.c_str())
65 runtime_error::runtime_error(const char* msg) : __imp_(msg)
69 runtime_error::runtime_error(const runtime_error& le) _NOEXCEPT
75 runtime_error::operator=(const runtime_error& le) _NOEXCEPT
81 #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
83 runtime_error::~runtime_error() _NOEXCEPT
88 runtime_error::what() const _NOEXCEPT
90 return __imp_.c_str();
93 domain_error::~domain_error() _NOEXCEPT {}
94 invalid_argument::~invalid_argument() _NOEXCEPT {}
95 length_error::~length_error() _NOEXCEPT {}
96 out_of_range::~out_of_range() _NOEXCEPT {}
98 range_error::~range_error() _NOEXCEPT {}
99 overflow_error::~overflow_error() _NOEXCEPT {}
100 underflow_error::~underflow_error() _NOEXCEPT {}