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