Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / input.output / iostream.format / input.streams / istream / istream.cons / copy.verify.cpp
blob90e5315a662b332b70afd3ff3550ce88d6ff8a63
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 //===----------------------------------------------------------------------===//
9 // <istream>
11 // template <class charT, class traits = char_traits<charT> >
12 // class basic_istream;
14 // basic_istream(basic_istream const& rhs) = delete;
15 // basic_istream& operator=(basic_istream const&) = delete;
17 #include <istream>
18 #include <type_traits>
19 #include <cassert>
21 struct test_istream
22 : public std::basic_istream<char>
24 typedef std::basic_istream<char> base;
26 test_istream(test_istream&& s)
27 : base(std::move(s)) // OK
31 test_istream& operator=(test_istream&& s) {
32 base::operator=(std::move(s)); // OK
33 return *this;
36 test_istream(test_istream const& s)
37 : base(s) // expected-error {{call to deleted constructor of 'std::basic_istream<char>'}}
41 test_istream& operator=(test_istream const& s) {
42 base::operator=(s); // expected-error {{call to deleted member function 'operator='}}
43 return *this;
48 int main(int, char**)
50 return 0;