1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: libcpp-no-exceptions
13 // template<class D, class A> shared_ptr(nullptr_t, D d, A a);
17 #include "../test_deleter.h"
18 #include "test_allocator.h"
25 A(const A&) {++count;}
35 test_allocator<A>::throw_after = 0;
36 std::shared_ptr<A> p(nullptr, test_deleter<A>(3), test_allocator<A>(5));
39 catch (std::bad_alloc&)
41 assert(A::count == 0);
42 assert(test_deleter<A>::count == 0);
43 assert(test_deleter<A>::dealloc_count == 1);
44 assert(test_allocator<A>::count == 0);
45 assert(test_allocator<A>::alloc_count == 0);