| 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 |
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 |
| 10 |
|
| 11 |
// <memory> |
| 12 |
|
| 13 |
// [out.ptr.t], class template out_ptr_t |
| 14 |
// template<class Smart, class Pointer, class... Args> |
| 15 |
// class out_ptr_t; // since c++23 |
| 16 |
|
| 17 |
#include <memory> |
| 18 |
|
| 19 |
int main(int, char**) { |
| 20 |
// `std::out_ptr_t<>` requires `std::shared_ptr<>` with a deleter. |
| 21 |
{ |
| 22 |
std::shared_ptr<int> sPtr; |
| 23 |
|
| 24 |
// expected-error-re@*:* {{static assertion failed due to requirement {{.*}}Using std::shared_ptr<> without a deleter in std::out_ptr is not supported.}} |
| 25 |
std::out_ptr_t<std::shared_ptr<int>, int*>{sPtr}; |
| 26 |
} |
| 27 |
|
| 28 |
return 0; |
| 29 |
} |