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 //===----------------------------------------------------------------------===//
8 // UNSUPPORTED: c++03, c++11, c++14, c++17
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
>
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
>
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
;
42 virtual ~Abstract() = 0;
45 enum Enum
{zero
, one
};
46 typedef void (*FunctionPtr
)();
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>();
65 test_array
<char[3], false>();
66 test_array
<int[0], false>();
67 test_array
<char[], true>();
68 test_array
<incomplete_type
[], true>();