1 //===---------------------------- exception.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 
10 #define _LIBCPP_BUILDING_LIBRARY
11 #include <new>
12 #include <exception>
13 
14 namespace std
15 {
16 
17 // exception
18 
19 exception::~exception() _NOEXCEPT
20 {
21 }
22 
23 const char* exception::what() const _NOEXCEPT
24 {
25   return "std::exception";
26 }
27 
28 // bad_exception
29 
30 bad_exception::~bad_exception() _NOEXCEPT
31 {
32 }
33 
34 const char* bad_exception::what() const _NOEXCEPT
35 {
36   return "std::bad_exception";
37 }
38 
39 
40 //  bad_alloc
41 
42 bad_alloc::bad_alloc() _NOEXCEPT
43 {
44 }
45 
46 bad_alloc::~bad_alloc() _NOEXCEPT
47 {
48 }
49 
50 const char*
51 bad_alloc::what() const _NOEXCEPT
52 {
53     return "std::bad_alloc";
54 }
55 
56 // bad_array_new_length
57 
58 bad_array_new_length::bad_array_new_length() _NOEXCEPT
59 {
60 }
61 
62 bad_array_new_length::~bad_array_new_length() _NOEXCEPT
63 {
64 }
65 
66 const char*
67 bad_array_new_length::what() const _NOEXCEPT
68 {
69     return "bad_array_new_length";
70 }
71 
72 // bad_array_length
73 
74 #ifndef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
75 
76 class _LIBCPP_EXCEPTION_ABI bad_array_length
77     : public bad_alloc
78 {
79 public:
80     bad_array_length() _NOEXCEPT;
81     virtual ~bad_array_length() _NOEXCEPT;
82     virtual const char* what() const _NOEXCEPT;
83 };
84 
85 #endif  // _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
86 
87 bad_array_length::bad_array_length() _NOEXCEPT
88 {
89 }
90 
91 bad_array_length::~bad_array_length() _NOEXCEPT
92 {
93 }
94 
95 const char*
96 bad_array_length::what() const _NOEXCEPT
97 {
98     return "bad_array_length";
99 }
100 
101 
102 }  // std
103