Howard Hinnant | a2bde87 | 2012-02-17 19:23:47 +0000 | [diff] [blame] | 1 | //===------------------------ stdexcept.cpp -------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Eric Fiselier | 28942d3 | 2017-07-12 01:34:21 +0000 | [diff] [blame^] | 10 | #include "include/refstring.h" |
Howard Hinnant | a2bde87 | 2012-02-17 19:23:47 +0000 | [diff] [blame] | 11 | #include "stdexcept" |
| 12 | #include "new" |
| 13 | #include <cstdlib> |
| 14 | #include <cstring> |
| 15 | #include <cstdint> |
| 16 | #include <cstddef> |
| 17 | |
Marshall Clow | f7a83f7 | 2014-05-07 20:17:41 +0000 | [diff] [blame] | 18 | static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), ""); |
Howard Hinnant | a2bde87 | 2012-02-17 19:23:47 +0000 | [diff] [blame] | 19 | |
| 20 | namespace std // purposefully not using versioning namespace |
| 21 | { |
| 22 | |
Marshall Clow | f7a83f7 | 2014-05-07 20:17:41 +0000 | [diff] [blame] | 23 | logic_error::~logic_error() _NOEXCEPT {} |
Howard Hinnant | a2bde87 | 2012-02-17 19:23:47 +0000 | [diff] [blame] | 24 | |
| 25 | const char* |
| 26 | logic_error::what() const _NOEXCEPT |
| 27 | { |
Marshall Clow | f7a83f7 | 2014-05-07 20:17:41 +0000 | [diff] [blame] | 28 | return __imp_.c_str(); |
Howard Hinnant | a2bde87 | 2012-02-17 19:23:47 +0000 | [diff] [blame] | 29 | } |
| 30 | |
Marshall Clow | f7a83f7 | 2014-05-07 20:17:41 +0000 | [diff] [blame] | 31 | runtime_error::~runtime_error() _NOEXCEPT {} |
Howard Hinnant | a2bde87 | 2012-02-17 19:23:47 +0000 | [diff] [blame] | 32 | |
| 33 | const char* |
| 34 | runtime_error::what() const _NOEXCEPT |
| 35 | { |
Marshall Clow | f7a83f7 | 2014-05-07 20:17:41 +0000 | [diff] [blame] | 36 | return __imp_.c_str(); |
Howard Hinnant | a2bde87 | 2012-02-17 19:23:47 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | domain_error::~domain_error() _NOEXCEPT {} |
| 40 | invalid_argument::~invalid_argument() _NOEXCEPT {} |
| 41 | length_error::~length_error() _NOEXCEPT {} |
| 42 | out_of_range::~out_of_range() _NOEXCEPT {} |
| 43 | |
| 44 | range_error::~range_error() _NOEXCEPT {} |
| 45 | overflow_error::~overflow_error() _NOEXCEPT {} |
| 46 | underflow_error::~underflow_error() _NOEXCEPT {} |
| 47 | |
| 48 | } // std |