default.pass.cpp revision a824f536004806c079b3b1dacdb5e1ef5bd533f9
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// <streambuf>
11
12// template <class charT, class traits = char_traits<charT> >
13// class basic_streambuf;
14
15// basic_streambuf();
16
17#include <streambuf>
18#include <cassert>
19
20template <class CharT>
21struct test
22    : public std::basic_streambuf<CharT>
23{
24    test()
25    {
26        assert(this->eback() == 0);
27        assert(this->gptr() == 0);
28        assert(this->egptr() == 0);
29        assert(this->pbase() == 0);
30        assert(this->pptr() == 0);
31        assert(this->epptr() == 0);
32    }
33};
34
35int main()
36{
37    {
38        test<char> t;
39        assert(t.getloc().name() == "C");
40    }
41    {
42        test<wchar_t> t;
43        assert(t.getloc().name() == "C");
44    }
45    std::locale::global(std::locale("en_US.UTF-8"));
46    {
47        test<char> t;
48        assert(t.getloc().name() == "en_US.UTF-8");
49    }
50    {
51        test<wchar_t> t;
52        assert(t.getloc().name() == "en_US.UTF-8");
53    }
54}
55