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(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT)
21 static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
24 namespace std // purposefully not using versioning namespace
27 logic_error::logic_error(const string& msg) : __imp_(msg.c_str())
31 logic_error::logic_error(const char* msg) : __imp_(msg)
35 logic_error::logic_error(const logic_error& le) _NOEXCEPT : __imp_(le.__imp_)
40 logic_error::operator=(const logic_error& le) _NOEXCEPT
46 #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
48 logic_error::~logic_error() _NOEXCEPT
53 logic_error::what() const _NOEXCEPT
55 return __imp_.c_str();
60 runtime_error::runtime_error(const string& msg) : __imp_(msg.c_str())
64 runtime_error::runtime_error(const char* msg) : __imp_(msg)
68 runtime_error::runtime_error(const runtime_error& le) _NOEXCEPT
74 runtime_error::operator=(const runtime_error& le) _NOEXCEPT
80 #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
82 runtime_error::~runtime_error() _NOEXCEPT
87 runtime_error::what() const _NOEXCEPT
89 return __imp_.c_str();
92 domain_error::~domain_error() _NOEXCEPT {}
93 invalid_argument::~invalid_argument() _NOEXCEPT {}
94 length_error::~length_error() _NOEXCEPT {}
95 out_of_range::~out_of_range() _NOEXCEPT {}
97 range_error::~range_error() _NOEXCEPT {}
98 overflow_error::~overflow_error() _NOEXCEPT {}
99 underflow_error::~underflow_error() _NOEXCEPT {}