forked from OSchip/llvm-project
parent
3369612808
commit
6e8ebb2ce9
|
@ -27,6 +27,18 @@ public:
|
|||
virtual const char* what() const noexcept;
|
||||
};
|
||||
|
||||
class bad_array_length : public bad_alloc // C++14
|
||||
{
|
||||
public:
|
||||
bad_array_length() noexcept;
|
||||
};
|
||||
|
||||
class bad_array_new_length : public bad_alloc
|
||||
{
|
||||
public:
|
||||
bad_array_new_length() noexcept;
|
||||
};
|
||||
|
||||
struct nothrow_t {};
|
||||
extern const nothrow_t nothrow;
|
||||
typedef void (*new_handler)();
|
||||
|
@ -81,6 +93,17 @@ public:
|
|||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
#if defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11)
|
||||
class _LIBCPP_EXCEPTION_ABI bad_array_length
|
||||
: public bad_alloc
|
||||
{
|
||||
public:
|
||||
bad_array_length() _NOEXCEPT;
|
||||
virtual ~bad_array_length() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
#endif
|
||||
|
||||
_LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
|
||||
|
||||
struct _LIBCPP_TYPE_VIS nothrow_t {};
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define _LIBCPP_BUILDING_NEW
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "new"
|
||||
|
@ -186,13 +188,27 @@ bad_array_new_length::~bad_array_new_length() _NOEXCEPT
|
|||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
bad_array_length::what() const _NOEXCEPT
|
||||
{
|
||||
return "bad_array_length";
|
||||
}
|
||||
|
||||
bad_array_length::bad_array_length() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_array_length::~bad_array_length() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
bad_array_new_length::what() const _NOEXCEPT
|
||||
{
|
||||
return "bad_array_new_length";
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // _LIBCPPABI_VERSION
|
||||
|
||||
void
|
||||
__throw_bad_alloc()
|
||||
|
|
Loading…
Reference in New Issue