• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // UNSUPPORTED: c++98, c++03
11 
12 // <istream>
13 
14 // template <class charT, class traits = char_traits<charT> >
15 // class basic_istream;
16 
17 // basic_istream(basic_istream const& rhs) = delete;
18 // basic_istream& operator=(basic_istream const&) = delete;
19 
20 #include <istream>
21 #include <type_traits>
22 #include <cassert>
23 
24 struct test_istream
25     : public std::basic_istream<char>
26 {
27     typedef std::basic_istream<char> base;
28 
test_istreamtest_istream29     test_istream(test_istream&& s)
30         : base(std::move(s)) // OK
31     {
32     }
33 
operator =test_istream34     test_istream& operator=(test_istream&& s) {
35       base::operator=(std::move(s)); // OK
36       return *this;
37     }
38 
test_istreamtest_istream39     test_istream(test_istream const& s)
40         : base(s) // expected-error {{call to deleted constructor of 'std::basic_istream<char>'}}
41     {
42     }
43 
operator =test_istream44     test_istream& operator=(test_istream const& s) {
45       base::operator=(s); // expected-error {{call to deleted member function 'operator='}}
46       return *this;
47     }
48 
49 };
50 
51 
main()52 int main()
53 {
54 
55 }
56