types.pass.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
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// <locale>
11
12// template <class CharT>
13// class ctype
14//     : public locale::facet,
15//       public ctype_base
16// {
17// public:
18//     typedef CharT char_type;
19// };
20
21#include <locale>
22#include <type_traits>
23#include <cassert>
24
25int main()
26{
27    std::locale l = std::locale::classic();
28    {
29        assert(std::has_facet<std::ctype<wchar_t> >(l));
30        const std::ctype<wchar_t>& f = std::use_facet<std::ctype<wchar_t> >(l);
31        {
32            (void)std::ctype<wchar_t>::id;
33        }
34        static_assert((std::is_same<std::ctype<wchar_t>::char_type, wchar_t>::value), "");
35        static_assert((std::is_base_of<std::ctype_base, std::ctype<wchar_t> >::value), "");
36        static_assert((std::is_base_of<std::locale::facet, std::ctype<wchar_t> >::value), "");
37    }
38}
39