//===----------------------------------------------------------------------===// // // 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 // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 // // template struct is_aggregate; // template constexpr bool is_aggregate_v = is_aggregate::value; #include #include "test_macros.h" template void test_true() { #if !defined(_LIBCPP_HAS_NO_IS_AGGREGATE) 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_v, ""); static_assert( std::is_aggregate_v, ""); static_assert( std::is_aggregate_v, ""); static_assert( std::is_aggregate_v, ""); #endif } template void test_false() { #if !defined(_LIBCPP_HAS_NO_IS_AGGREGATE) 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_v, ""); static_assert(!std::is_aggregate_v, ""); static_assert(!std::is_aggregate_v, ""); static_assert(!std::is_aggregate_v, ""); #endif } struct Aggregate {}; struct HasCons { HasCons(int); }; struct HasPriv { void PreventUnusedPrivateMemberWarning(); private: int x; }; struct Union { int x; void* y; }; int main(int, char**) { { test_false(); test_false(); test_false(); test_false(); test_false(); test_false(); test_false(); test_false(); test_false(); } { test_true(); test_true(); test_true(); test_true(); } return 0; }