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 // XFAIL: libcpp-no-exceptions
11 // UNSUPPORTED: sanitizer-new-delete
17 // template<class Y, class D> shared_ptr(Y* p, D d);
24 #include "count_new.hpp"
25 #include "../test_deleter.h"
32 A(const A&) {++count;}
41 globalMemCounter.throw_after = 0;
44 std::shared_ptr<A> p(ptr, test_deleter<A>(3));
47 catch (std::bad_alloc&)
49 assert(A::count == 0);
50 assert(test_deleter<A>::count == 0);
51 assert(test_deleter<A>::dealloc_count == 1);
53 assert(globalMemCounter.checkOutstandingNewEq(0));