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// template <class U>
14// constexpr default_delete(const default_delete<U[]>&); // constexpr since C++23
15//
16// This constructor shall not participate in overload resolution unless
17// U(*)[] is convertible to T(*)[].
18
19#include <memory>
20#include <cassert>
21
22#include "test_macros.h"
23
24TEST_CONSTEXPR_CXX23 bool test() {
25 std::default_delete<int[]> d1;
26 std::default_delete<const int[]> d2 = d1;
27 ((void)d2);
28
29 return true;
30}
31
32int main(int, char**) {
33 test();
34#if TEST_STD_VER >= 23
35 static_assert(test());
36#endif
37
38 return 0;
39}
40

source code of libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp