| 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 | // [inout.ptr.t], class template inout_ptr_t |
| 14 | // template<class Smart, class Pointer, class... Args> |
| 15 | // class inout_ptr_t; // since c++23 |
| 16 | |
| 17 | #include <memory> |
| 18 | |
| 19 | int main(int, char**) { |
| 20 | // `std::inout_ptr<>` does not support `std::shared_ptr<>`. |
| 21 | { |
| 22 | std::shared_ptr<int> sPtr; |
| 23 | |
| 24 | // expected-error-re@*:* {{static assertion failed due to requirement {{.*}}std::shared_ptr<> is not supported with std::inout_ptr.}} |
| 25 | std::inout_ptr_t<std::shared_ptr<int>, int*>{sPtr}; |
| 26 | } |
| 27 | |
| 28 | return 0; |
| 29 | } |
| 30 | |