diff options
Diffstat (limited to 'libcxx/test/utilities/function.objects/func.wrap')
-rw-r--r-- | libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h index c5da7e6390d..eed33a0e3ea 100644 --- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h +++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h @@ -48,8 +48,13 @@ public: const_pointer address(const_reference x) const {return &x;} pointer allocate(size_type n, const void* = 0) { - if (count >= throw_after) + if (count >= throw_after) { +#ifndef _LIBCPP_NO_EXCEPTIONS throw std::bad_alloc(); +#else + std::terminate(); +#endif + } ++count; return (pointer)std::malloc(n * sizeof(T)); } |