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++98, c++03 10 // Because we don't have a functioning decltype in C++03 11 12 // <memory> 13 14 // unique_ptr 15 16 // template<class CharT, class Traits, class Y, class D> 17 // basic_ostream<CharT, Traits>& 18 // operator<<(basic_ostream<CharT, Traits>& os, const unique_ptr<Y, D>& p); 19 20 // -?- Remarks: This function shall not participate in overload resolution unless os << p.get() is a valid expression. 21 22 #include <memory> 23 #include <sstream> 24 #include <cassert> 25 26 #include "min_allocator.h" 27 #include "deleter_types.h" 28 29 int main(int, char**) 30 { 31 std::unique_ptr<int, PointerDeleter<int>> p; 32 std::ostringstream os; 33 os << p; // expected-error {{invalid operands to binary expression}} 34 35 return 0; 36 } 37