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 // remove_all_extents
13 
14 #include <type_traits>
15 
16 enum Enum {zero, one_};
17 
18 template <class T, class U>
test_remove_all_extents()19 void test_remove_all_extents()
20 {
21     static_assert((std::is_same<typename std::remove_all_extents<T>::type, U>::value), "");
22 #if _LIBCPP_STD_VER > 11
23     static_assert((std::is_same<std::remove_all_extents_t<T>,     U>::value), "");
24 #endif
25 }
26 
main()27 int main()
28 {
29     test_remove_all_extents<int, int> ();
30     test_remove_all_extents<const Enum, const Enum> ();
31     test_remove_all_extents<int[], int> ();
32     test_remove_all_extents<const int[], const int> ();
33     test_remove_all_extents<int[3], int> ();
34     test_remove_all_extents<const int[3], const int> ();
35     test_remove_all_extents<int[][3], int> ();
36     test_remove_all_extents<const int[][3], const int> ();
37     test_remove_all_extents<int[2][3], int> ();
38     test_remove_all_extents<const int[2][3], const int> ();
39     test_remove_all_extents<int[1][2][3], int> ();
40     test_remove_all_extents<const int[1][2][3], const int> ();
41 }
42