//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // Make sure std::array is an aggregate type. #include #include template void tests() { // Test aggregate initialization { std::array a0 = {}; (void)a0; std::array a1 = {T()}; (void)a1; std::array a2 = {T(), T()}; (void)a2; std::array a3 = {T(), T(), T()}; (void)a3; } // Test the is_aggregate trait. #if TEST_STD_VER >= 17 // The trait is only available in C++17 and above static_assert(std::is_aggregate >::value, ""); static_assert(std::is_aggregate >::value, ""); static_assert(std::is_aggregate >::value, ""); static_assert(std::is_aggregate >::value, ""); static_assert(std::is_aggregate >::value, ""); #endif } struct Empty { }; struct NonEmpty { int i; int j; }; int main(int, char**) { tests(); tests(); tests(); tests(); tests(); tests(); tests(); tests(); return 0; }