1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // type_traits
10
11 // remove_extent
12
13 #include <type_traits>
14
15 #include "test_macros.h"
16
17 enum Enum {zero, one_};
18
19 template <class T, class U>
test_remove_extent()20 void test_remove_extent()
21 {
22 ASSERT_SAME_TYPE(U, typename std::remove_extent<T>::type);
23 #if TEST_STD_VER > 11
24 ASSERT_SAME_TYPE(U, std::remove_extent_t<T>);
25 #endif
26 }
27
28
main(int,char **)29 int main(int, char**)
30 {
31 test_remove_extent<int, int> ();
32 test_remove_extent<const Enum, const Enum> ();
33 test_remove_extent<int[], int> ();
34 test_remove_extent<const int[], const int> ();
35 test_remove_extent<int[3], int> ();
36 test_remove_extent<const int[3], const int> ();
37 test_remove_extent<int[][3], int[3]> ();
38 test_remove_extent<const int[][3], const int[3]> ();
39 test_remove_extent<int[2][3], int[3]> ();
40 test_remove_extent<const int[2][3], const int[3]> ();
41 test_remove_extent<int[1][2][3], int[2][3]> ();
42 test_remove_extent<const int[1][2][3], const int[2][3]> ();
43
44 return 0;
45 }
46