/Users/buildslave/jenkins/workspace/coverage/llvm-project/libcxx/src/support/runtime/stdexcept_default.ipp
Line | Count | Source (jump to first uncovered line) |
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 "../../include/refstring.h" |
10 | | |
11 | | /* For _LIBCPPABI_VERSION */ |
12 | | #if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && \ |
13 | | (defined(LIBCXX_BUILDING_LIBCXXABI) || defined(LIBCXXRT)) |
14 | | #include <cxxabi.h> |
15 | | #endif |
16 | | |
17 | | static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char*), ""); |
18 | | |
19 | | namespace std // purposefully not using versioning namespace |
20 | | { |
21 | | |
22 | 0 | logic_error::logic_error(const string& msg) : __imp_(msg.c_str()) {} |
23 | | |
24 | 0 | logic_error::logic_error(const char* msg) : __imp_(msg) {} |
25 | | |
26 | 0 | logic_error::logic_error(const logic_error& le) noexcept : __imp_(le.__imp_) {} |
27 | | |
28 | 0 | logic_error& logic_error::operator=(const logic_error& le) noexcept { |
29 | 0 | __imp_ = le.__imp_; |
30 | 0 | return *this; |
31 | 0 | } |
32 | | |
33 | 0 | runtime_error::runtime_error(const string& msg) : __imp_(msg.c_str()) {} |
34 | | |
35 | 0 | runtime_error::runtime_error(const char* msg) : __imp_(msg) {} |
36 | | |
37 | | runtime_error::runtime_error(const runtime_error& re) noexcept |
38 | 0 | : __imp_(re.__imp_) {} |
39 | | |
40 | 0 | runtime_error& runtime_error::operator=(const runtime_error& re) noexcept { |
41 | 0 | __imp_ = re.__imp_; |
42 | 0 | return *this; |
43 | 0 | } |
44 | | |
45 | | #if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX) |
46 | | |
47 | | const char* logic_error::what() const noexcept { return __imp_.c_str(); } |
48 | | |
49 | | const char* runtime_error::what() const noexcept { return __imp_.c_str(); } |
50 | | |
51 | | logic_error::~logic_error() noexcept {} |
52 | | domain_error::~domain_error() noexcept {} |
53 | | invalid_argument::~invalid_argument() noexcept {} |
54 | | length_error::~length_error() noexcept {} |
55 | | out_of_range::~out_of_range() noexcept {} |
56 | | |
57 | | runtime_error::~runtime_error() noexcept {} |
58 | | range_error::~range_error() noexcept {} |
59 | | overflow_error::~overflow_error() noexcept {} |
60 | | underflow_error::~underflow_error() noexcept {} |
61 | | |
62 | | #endif |
63 | | |
64 | | } // namespace std |