//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // 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 () { { 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(); } }