Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===--------------------------- stdexcept --------------------------------===// |
| 3 | // |
Chandler Carruth | d201210 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_STDEXCEPT |
| 11 | #define _LIBCPP_STDEXCEPT |
| 12 | |
| 13 | /* |
| 14 | stdexcept synopsis |
| 15 | |
| 16 | namespace std |
| 17 | { |
| 18 | |
| 19 | class logic_error; |
| 20 | class domain_error; |
| 21 | class invalid_argument; |
| 22 | class length_error; |
| 23 | class out_of_range; |
| 24 | class runtime_error; |
| 25 | class range_error; |
| 26 | class overflow_error; |
| 27 | class underflow_error; |
| 28 | |
| 29 | for each class xxx_error: |
| 30 | |
| 31 | class xxx_error : public exception // at least indirectly |
| 32 | { |
| 33 | public: |
| 34 | explicit xxx_error(const string& what_arg); |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 35 | explicit xxx_error(const char* what_arg); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 36 | |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 37 | virtual const char* what() const noexcept // returns what_arg |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | } // std |
| 41 | |
| 42 | */ |
| 43 | |
| 44 | #include <__config> |
| 45 | #include <exception> |
| 46 | #include <iosfwd> // for string forward decl |
Eric Fiselier | 279c319 | 2016-09-06 21:25:27 +0000 | [diff] [blame] | 47 | #ifdef _LIBCPP_NO_EXCEPTIONS |
| 48 | #include <cstdlib> |
| 49 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 50 | |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 51 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 52 | #pragma GCC system_header |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 53 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 54 | |
Joerg Sonnenberger | a47c2e7 | 2014-04-30 19:54:11 +0000 | [diff] [blame] | 55 | _LIBCPP_BEGIN_NAMESPACE_STD |
Eric Fiselier | 1e65516 | 2016-10-25 19:33:14 +0000 | [diff] [blame] | 56 | |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 57 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Eric Fiselier | 1e65516 | 2016-10-25 19:33:14 +0000 | [diff] [blame] | 58 | class _LIBCPP_HIDDEN __libcpp_refstring |
| 59 | { |
| 60 | const char* __imp_; |
| 61 | |
| 62 | bool __uses_refcount() const; |
| 63 | public: |
Eric Fiselier | c5ea1ae | 2017-06-01 02:29:37 +0000 | [diff] [blame] | 64 | explicit __libcpp_refstring(const char* __msg); |
| 65 | __libcpp_refstring(const __libcpp_refstring& __s) _NOEXCEPT; |
| 66 | __libcpp_refstring& operator=(const __libcpp_refstring& __s) _NOEXCEPT; |
Eric Fiselier | 1e65516 | 2016-10-25 19:33:14 +0000 | [diff] [blame] | 67 | ~__libcpp_refstring(); |
| 68 | |
| 69 | const char* c_str() const _NOEXCEPT {return __imp_;} |
Joerg Sonnenberger | a47c2e7 | 2014-04-30 19:54:11 +0000 | [diff] [blame] | 70 | }; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 71 | #endif // !_LIBCPP_ABI_VCRUNTIME |
Eric Fiselier | 1e65516 | 2016-10-25 19:33:14 +0000 | [diff] [blame] | 72 | |
Joerg Sonnenberger | a47c2e7 | 2014-04-30 19:54:11 +0000 | [diff] [blame] | 73 | _LIBCPP_END_NAMESPACE_STD |
Joerg Sonnenberger | a47c2e7 | 2014-04-30 19:54:11 +0000 | [diff] [blame] | 74 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 75 | namespace std // purposefully not using versioning namespace |
| 76 | { |
| 77 | |
| 78 | class _LIBCPP_EXCEPTION_ABI logic_error |
| 79 | : public exception |
| 80 | { |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 81 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 82 | private: |
Joerg Sonnenberger | a47c2e7 | 2014-04-30 19:54:11 +0000 | [diff] [blame] | 83 | _VSTD::__libcpp_refstring __imp_; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 84 | public: |
| 85 | explicit logic_error(const string&); |
| 86 | explicit logic_error(const char*); |
| 87 | |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 88 | logic_error(const logic_error&) _NOEXCEPT; |
| 89 | logic_error& operator=(const logic_error&) _NOEXCEPT; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 90 | |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 91 | virtual ~logic_error() _NOEXCEPT; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 92 | |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 93 | virtual const char* what() const _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 94 | #else |
| 95 | public: |
| 96 | explicit logic_error(const _VSTD::string&); // Symbol uses versioned std::string |
| 97 | _LIBCPP_INLINE_VISIBILITY explicit logic_error(const char* __s) : exception(__s) {} |
| 98 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 99 | }; |
| 100 | |
| 101 | class _LIBCPP_EXCEPTION_ABI runtime_error |
| 102 | : public exception |
| 103 | { |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 104 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 105 | private: |
Joerg Sonnenberger | a47c2e7 | 2014-04-30 19:54:11 +0000 | [diff] [blame] | 106 | _VSTD::__libcpp_refstring __imp_; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 107 | public: |
| 108 | explicit runtime_error(const string&); |
| 109 | explicit runtime_error(const char*); |
| 110 | |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 111 | runtime_error(const runtime_error&) _NOEXCEPT; |
| 112 | runtime_error& operator=(const runtime_error&) _NOEXCEPT; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 113 | |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 114 | virtual ~runtime_error() _NOEXCEPT; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 115 | |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 116 | virtual const char* what() const _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 117 | #else |
| 118 | public: |
| 119 | explicit runtime_error(const _VSTD::string&); // Symbol uses versioned std::string |
| 120 | _LIBCPP_INLINE_VISIBILITY explicit runtime_error(const char* __s) : exception(__s) {} |
| 121 | #endif // _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 122 | }; |
| 123 | |
| 124 | class _LIBCPP_EXCEPTION_ABI domain_error |
| 125 | : public logic_error |
| 126 | { |
| 127 | public: |
| 128 | _LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {} |
| 129 | _LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {} |
| 130 | |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 131 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 132 | virtual ~domain_error() _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 133 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 134 | }; |
| 135 | |
| 136 | class _LIBCPP_EXCEPTION_ABI invalid_argument |
| 137 | : public logic_error |
| 138 | { |
| 139 | public: |
| 140 | _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {} |
| 141 | _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {} |
| 142 | |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 143 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 144 | virtual ~invalid_argument() _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 145 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 146 | }; |
| 147 | |
| 148 | class _LIBCPP_EXCEPTION_ABI length_error |
| 149 | : public logic_error |
| 150 | { |
| 151 | public: |
| 152 | _LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {} |
| 153 | _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {} |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 154 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 155 | virtual ~length_error() _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 156 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 157 | }; |
| 158 | |
| 159 | class _LIBCPP_EXCEPTION_ABI out_of_range |
| 160 | : public logic_error |
| 161 | { |
| 162 | public: |
| 163 | _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {} |
| 164 | _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {} |
| 165 | |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 166 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 167 | virtual ~out_of_range() _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 168 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 169 | }; |
| 170 | |
| 171 | class _LIBCPP_EXCEPTION_ABI range_error |
| 172 | : public runtime_error |
| 173 | { |
| 174 | public: |
| 175 | _LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {} |
| 176 | _LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {} |
| 177 | |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 178 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 179 | virtual ~range_error() _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 180 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 181 | }; |
| 182 | |
| 183 | class _LIBCPP_EXCEPTION_ABI overflow_error |
| 184 | : public runtime_error |
| 185 | { |
| 186 | public: |
| 187 | _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {} |
| 188 | _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {} |
| 189 | |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 190 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 191 | virtual ~overflow_error() _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 192 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 193 | }; |
| 194 | |
| 195 | class _LIBCPP_EXCEPTION_ABI underflow_error |
| 196 | : public runtime_error |
| 197 | { |
| 198 | public: |
| 199 | _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {} |
| 200 | _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {} |
| 201 | |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 202 | #ifndef _LIBCPP_ABI_VCRUNTIME |
Howard Hinnant | 1f098bc | 2011-05-26 19:48:01 +0000 | [diff] [blame] | 203 | virtual ~underflow_error() _NOEXCEPT; |
Eric Fiselier | c6e689b | 2019-03-06 20:31:57 +0000 | [diff] [blame^] | 204 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 205 | }; |
| 206 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 207 | } // std |
| 208 | |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 209 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 210 | |
| 211 | // in the dylib |
| 212 | _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); |
| 213 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 214 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 215 | void __throw_logic_error(const char*__msg) |
| 216 | { |
| 217 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 218 | throw logic_error(__msg); |
| 219 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 220 | ((void)__msg); |
Louis Dionne | 44bcff9 | 2018-08-03 22:36:53 +0000 | [diff] [blame] | 221 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 222 | #endif |
| 223 | } |
| 224 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 225 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 226 | void __throw_domain_error(const char*__msg) |
| 227 | { |
| 228 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 229 | throw domain_error(__msg); |
| 230 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 231 | ((void)__msg); |
Louis Dionne | 44bcff9 | 2018-08-03 22:36:53 +0000 | [diff] [blame] | 232 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 233 | #endif |
| 234 | } |
| 235 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 236 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 237 | void __throw_invalid_argument(const char*__msg) |
| 238 | { |
| 239 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 240 | throw invalid_argument(__msg); |
| 241 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 242 | ((void)__msg); |
Louis Dionne | 44bcff9 | 2018-08-03 22:36:53 +0000 | [diff] [blame] | 243 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 244 | #endif |
| 245 | } |
| 246 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 247 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 248 | void __throw_length_error(const char*__msg) |
| 249 | { |
| 250 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 251 | throw length_error(__msg); |
| 252 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 253 | ((void)__msg); |
Louis Dionne | 44bcff9 | 2018-08-03 22:36:53 +0000 | [diff] [blame] | 254 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 255 | #endif |
| 256 | } |
| 257 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 258 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 259 | void __throw_out_of_range(const char*__msg) |
| 260 | { |
| 261 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 262 | throw out_of_range(__msg); |
| 263 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 264 | ((void)__msg); |
Louis Dionne | 44bcff9 | 2018-08-03 22:36:53 +0000 | [diff] [blame] | 265 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 266 | #endif |
| 267 | } |
| 268 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 269 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 270 | void __throw_range_error(const char*__msg) |
| 271 | { |
| 272 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 273 | throw range_error(__msg); |
| 274 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 275 | ((void)__msg); |
Louis Dionne | 44bcff9 | 2018-08-03 22:36:53 +0000 | [diff] [blame] | 276 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 277 | #endif |
| 278 | } |
| 279 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 280 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 281 | void __throw_overflow_error(const char*__msg) |
| 282 | { |
| 283 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 284 | throw overflow_error(__msg); |
| 285 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 286 | ((void)__msg); |
| 287 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 288 | #endif |
| 289 | } |
| 290 | |
Louis Dionne | 16fe295 | 2018-07-11 23:14:33 +0000 | [diff] [blame] | 291 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 292 | void __throw_underflow_error(const char*__msg) |
| 293 | { |
| 294 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 295 | throw underflow_error(__msg); |
| 296 | #else |
Eric Fiselier | 6003c77 | 2016-12-23 23:37:52 +0000 | [diff] [blame] | 297 | ((void)__msg); |
| 298 | _VSTD::abort(); |
Marshall Clow | 8fea161 | 2016-08-25 15:09:01 +0000 | [diff] [blame] | 299 | #endif |
| 300 | } |
| 301 | |
| 302 | _LIBCPP_END_NAMESPACE_STD |
| 303 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 304 | #endif // _LIBCPP_STDEXCEPT |