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 // type_traits
11 
12 // is_literal_type
13 
14 #include <type_traits>
15 
16 template <class T>
test_is_literal_type()17 void test_is_literal_type()
18 {
19     static_assert( std::is_literal_type<T>::value, "");
20 }
21 
22 template <class T>
test_is_not_literal_type()23 void test_is_not_literal_type()
24 {
25     static_assert(!std::is_literal_type<T>::value, "");
26 }
27 
28 struct A
29 {
30 };
31 
32 struct B
33 {
34     B();
35 };
36 
main()37 int main()
38 {
39     test_is_literal_type<int> ();
40     test_is_literal_type<const int> ();
41     test_is_literal_type<int&> ();
42     test_is_literal_type<volatile int&> ();
43     test_is_literal_type<A> ();
44 
45     test_is_not_literal_type<B> ();
46 }
47