Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279744 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -50,11 +50,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void* do_allocate(size_t, size_t) {
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
throw std::bad_alloc();
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
__throw_bad_alloc();
|
||||
}
|
||||
virtual void do_deallocate(void *, size_t, size_t) {}
|
||||
virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT
|
||||
|
||||
Reference in New Issue
Block a user