1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 #include <type_traits>
15 #include "test_macros.h"
17 template <class T
, unsigned A
>
20 static_assert( std::rank
<T
>::value
== A
, "");
21 static_assert( std::rank
<const T
>::value
== A
, "");
22 static_assert( std::rank
<volatile T
>::value
== A
, "");
23 static_assert( std::rank
<const volatile T
>::value
== A
, "");
25 static_assert( std::rank_v
<T
> == A
, "");
26 static_assert( std::rank_v
<const T
> == A
, "");
27 static_assert( std::rank_v
<volatile T
> == A
, "");
28 static_assert( std::rank_v
<const volatile T
> == A
, "");
42 test_rank
<Class
, 0>();
44 test_rank
<const int*, 0>();
46 test_rank
<double, 0>();
48 test_rank
<unsigned, 0>();
50 test_rank
<char[3], 1>();
51 test_rank
<char[][3], 2>();
52 test_rank
<char[][4][3], 3>();