Home | History | Annotate | Download | only in src
      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 
     20 exception::~exception() _NOEXCEPT
     21 {
     22 }
     23 
     24 const char* exception::what() const _NOEXCEPT
     25 {
     26   return "std::exception";
     27 }
     28 
     29 // bad_exception
     30 
     31 bad_exception::~bad_exception() _NOEXCEPT
     32 {
     33 }
     34 
     35 const char* bad_exception::what() const _NOEXCEPT
     36 {
     37   return "std::bad_exception";
     38 }
     39 
     40 
     41 //  bad_alloc
     42 
     43 bad_alloc::bad_alloc() _NOEXCEPT
     44 {
     45 }
     46 
     47 bad_alloc::~bad_alloc() _NOEXCEPT
     48 {
     49 }
     50 
     51 const char*
     52 bad_alloc::what() const _NOEXCEPT
     53 {
     54     return "std::bad_alloc";
     55 }
     56 
     57 // bad_array_new_length
     58 
     59 bad_array_new_length::bad_array_new_length() _NOEXCEPT
     60 {
     61 }
     62 
     63 bad_array_new_length::~bad_array_new_length() _NOEXCEPT
     64 {
     65 }
     66 
     67 const char*
     68 bad_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 
     88 bad_array_length::bad_array_length() _NOEXCEPT
     89 {
     90 }
     91 
     92 bad_array_length::~bad_array_length() _NOEXCEPT
     93 {
     94 }
     95 
     96 const char*
     97 bad_array_length::what() const _NOEXCEPT
     98 {
     99     return "bad_array_length";
    100 }
    101 
    102 
    103 }  // std
    104