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 Y, class D, class A> shared_ptr(Y* p, D d, A a);
17 #include "../test_deleter.h"
18 #include "test_allocator.h"
25 A(const A&) {++count;}
36 test_allocator<A>::throw_after = 0;
37 std::shared_ptr<A> p(ptr, test_deleter<A>(3), test_allocator<A>(5));
40 catch (std::bad_alloc&)
42 assert(A::count == 0);
43 assert(test_deleter<A>::count == 0);
44 assert(test_deleter<A>::dealloc_count == 1);
45 assert(test_allocator<A>::count == 0);
46 assert(test_allocator<A>::alloc_count == 0);