//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // // [inout.ptr], function template inout_ptr // template // auto inout_ptr(Smart& s, Args&&... args); // since c++23 #include #include #include "../types.h" int main(int, char**) { // `std::inout_ptr<>` does not support `std::shared_ptr<>`. { std::shared_ptr sPtr; // expected-error-re@*:* {{static assertion failed due to requirement {{.*}}std::shared_ptr<> is not supported}} std::ignore = std::inout_ptr(sPtr); // expected-error-re@*:* {{no matching conversion for functional-style cast from 'std::shared_ptr' to 'std::inout_ptr_t<{{(std::)?}}shared_ptr, _Ptr>'{{( \(aka 'inout_ptr_t, int *>')?}}}} std::ignore = std::inout_ptr(sPtr); } return 0; }