brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · fba0f61 Raw
35 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2010 11// <memory>12 13// [inout.ptr], function template inout_ptr14// template<class Pointer = void, class Smart, class... Args>15//   auto inout_ptr(Smart& s, Args&&... args);                 // since c++2316 17#include <memory>18#include <tuple>19 20#include "../types.h"21 22int main(int, char**) {23  // `std::inout_ptr<>` does not support `std::shared_ptr<>`.24  {25    std::shared_ptr<int> sPtr;26 27    // expected-error-re@*:* {{static assertion failed due to requirement {{.*}}std::shared_ptr<> is not supported}}28    std::ignore = std::inout_ptr(sPtr);29    // expected-error-re@*:* {{no matching conversion for functional-style cast from 'std::shared_ptr<int>' to 'std::inout_ptr_t<{{(std::)?}}shared_ptr<int>, _Ptr>'{{( \(aka 'inout_ptr_t<std::shared_ptr<int>, int *>')?}}}}30    std::ignore = std::inout_ptr<int*>(sPtr);31  }32 33  return 0;34}35