1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// <memory>
10
11// default_delete
12
13#include <memory>
14#include <cassert>
15
16#include "test_macros.h"
17#include "unique_ptr_test_helper.h"
18
19TEST_CONSTEXPR_CXX23 bool test() {
20 std::default_delete<A> d;
21 A* p = new A;
22 if (!TEST_IS_CONSTANT_EVALUATED)
23 assert(A::count == 1);
24
25 d(p);
26
27 if (!TEST_IS_CONSTANT_EVALUATED)
28 assert(A::count == 0);
29
30 return true;
31}
32
33int main(int, char**) {
34 test();
35#if TEST_STD_VER >= 23
36 static_assert(test());
37#endif
38
39 return 0;
40}
41

source code of libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp