xref: /llvm-project/libcxxabi/src/stdlib_stdexcept.cpp (revision eb8650a75793b2bd079d0c8901ff066f129061da)
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "stdexcept"
10 #include "new"
11 #include <cstdlib>
12 #include <cstring>
13 #include <cstdint>
14 #include <cstddef>
15 #include "include/refstring.h" // from libc++
16 
17 static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
18 
19 namespace std  // purposefully not using versioning namespace
20 {
21 
~logic_error()22 logic_error::~logic_error() noexcept {}
23 
24 const char*
what() const25 logic_error::what() const noexcept
26 {
27     return __imp_.c_str();
28 }
29 
~runtime_error()30 runtime_error::~runtime_error() noexcept {}
31 
32 const char*
what() const33 runtime_error::what() const noexcept
34 {
35     return __imp_.c_str();
36 }
37 
~domain_error()38 domain_error::~domain_error() noexcept {}
~invalid_argument()39 invalid_argument::~invalid_argument() noexcept {}
~length_error()40 length_error::~length_error() noexcept {}
~out_of_range()41 out_of_range::~out_of_range() noexcept {}
42 
~range_error()43 range_error::~range_error() noexcept {}
~overflow_error()44 overflow_error::~overflow_error() noexcept {}
~underflow_error()45 underflow_error::~underflow_error() noexcept {}
46 
47 }  // std
48