Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 1 | //===------------------------ stdexcept.cpp -------------------------------===// |
| 2 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 | [diff] [blame] | 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 |
Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Eric Fiselier | 84800d9 | 2017-07-12 01:34:21 | [diff] [blame] | 9 | #include "include/refstring.h" |
Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 10 | #include "stdexcept" |
| 11 | #include "new" |
| 12 | #include <cstdlib> |
| 13 | #include <cstring> |
| 14 | #include <cstdint> |
| 15 | #include <cstddef> |
| 16 | |
Marshall Clow | 1f6f59a | 2014-05-07 20:17:41 | [diff] [blame] | 17 | static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), ""); |
Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 18 | |
| 19 | namespace std // purposefully not using versioning namespace |
| 20 | { |
| 21 | |
Marshall Clow | 1f6f59a | 2014-05-07 20:17:41 | [diff] [blame] | 22 | logic_error::~logic_error() _NOEXCEPT {} |
Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 23 | |
| 24 | const char* |
| 25 | logic_error::what() const _NOEXCEPT |
| 26 | { |
Marshall Clow | 1f6f59a | 2014-05-07 20:17:41 | [diff] [blame] | 27 | return __imp_.c_str(); |
Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 28 | } |
| 29 | |
Marshall Clow | 1f6f59a | 2014-05-07 20:17:41 | [diff] [blame] | 30 | runtime_error::~runtime_error() _NOEXCEPT {} |
Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 31 | |
| 32 | const char* |
| 33 | runtime_error::what() const _NOEXCEPT |
| 34 | { |
Marshall Clow | 1f6f59a | 2014-05-07 20:17:41 | [diff] [blame] | 35 | return __imp_.c_str(); |
Howard Hinnant | 3e7d155 | 2012-02-17 19:23:47 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | domain_error::~domain_error() _NOEXCEPT {} |
| 39 | invalid_argument::~invalid_argument() _NOEXCEPT {} |
| 40 | length_error::~length_error() _NOEXCEPT {} |
| 41 | out_of_range::~out_of_range() _NOEXCEPT {} |
| 42 | |
| 43 | range_error::~range_error() _NOEXCEPT {} |
| 44 | overflow_error::~overflow_error() _NOEXCEPT {} |
| 45 | underflow_error::~underflow_error() _NOEXCEPT {} |
| 46 | |
| 47 | } // std |