Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.unary / meta.unary.comp / is_unbounded_array.pass.cpp
blobea5383984262da352c1e2caeec24c3723ae15d3b
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 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // type_traits
12 // is_unbounded_array<T>
13 // T is an array type of unknown bound ([dcl.array])
15 #include <type_traits>
17 #include "test_macros.h"
19 template <class T, bool B>
20 void test_array_imp()
22 static_assert( B == std::is_unbounded_array<T>::value, "" );
23 static_assert( B == std::is_unbounded_array_v<T>, "" );
26 template <class T, bool B>
27 void test_array()
29 test_array_imp<T, B>();
30 test_array_imp<const T, B>();
31 test_array_imp<volatile T, B>();
32 test_array_imp<const volatile T, B>();
35 class incomplete_type;
37 class Empty {};
38 union Union {};
40 class Abstract
42 virtual ~Abstract() = 0;
45 enum Enum {zero, one};
46 typedef void (*FunctionPtr)();
48 int main(int, char**)
50 // Non-array types
51 test_array<void, false>();
52 test_array<std::nullptr_t, false>();
53 test_array<int, false>();
54 test_array<double, false>();
55 test_array<void *, false>();
56 test_array<int &, false>();
57 test_array<int &&, false>();
58 test_array<Empty, false>();
59 test_array<Union, false>();
60 test_array<Abstract, false>();
61 test_array<Enum, false>();
62 test_array<FunctionPtr, false>();
64 // Array types
65 test_array<char[3], false>();
66 test_array<int[0], false>();
67 test_array<char[], true>();
68 test_array<incomplete_type[], true>();
70 return 0;