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// <istream>
11
12// template <class charT, class traits = char_traits<charT> >
13//   class basic_istream;
14
15// basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>&
16//                                         (*pf)(basic_istream<charT,traits>&));
17
18#include <istream>
19#include <cassert>
20
21int f_called = 0;
22
23template <class CharT>
24std::basic_istream<CharT>&
25f(std::basic_istream<CharT>& is)
26{
27    ++f_called;
28    return is;
29}
30
31int main()
32{
33    {
34        std::istream is((std::streambuf*)0);
35        is >> f;
36        assert(f_called == 1);
37    }
38}
39