diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1367,10 +1367,6 @@ #define _LIBCPP_HAS_NO_DEDUCTION_GUIDES #endif -#if !__has_keyword(__is_aggregate) && (_GNUC_VER_NEW < 7001) -#define _LIBCPP_HAS_NO_IS_AGGREGATE -#endif - #if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L #define _LIBCPP_HAS_NO_COROUTINES #endif diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -1681,7 +1681,7 @@ #endif // is_aggregate -#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE) +#if _LIBCPP_STD_VER > 14 template struct _LIBCPP_TEMPLATE_VIS is_aggregate : public integral_constant {}; @@ -1692,7 +1692,7 @@ = is_aggregate<_Tp>::value; #endif -#endif // _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE) +#endif // _LIBCPP_STD_VER > 14 // is_base_of diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -228,9 +228,7 @@ # define __cpp_lib_hypot 201603L # define __cpp_lib_incomplete_container_elements 201505L # define __cpp_lib_invoke 201411L -# if !defined(_LIBCPP_HAS_NO_IS_AGGREGATE) -# define __cpp_lib_is_aggregate 201703L -# endif +# define __cpp_lib_is_aggregate 201703L # define __cpp_lib_is_invocable 201703L # define __cpp_lib_is_swappable 201603L # define __cpp_lib_launder 201606L diff --git a/libcxx/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/missing_is_aggregate_trait.compile.fail.cpp b/libcxx/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/missing_is_aggregate_trait.compile.fail.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/missing_is_aggregate_trait.compile.fail.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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++03, c++11, c++14 - -// - -// template struct is_aggregate; -// template constexpr bool is_aggregate_v = is_aggregate::value; - -#include - -int main(int, char**) -{ -#ifdef _LIBCPP_HAS_NO_IS_AGGREGATE - // This should not compile when _LIBCPP_HAS_NO_IS_AGGREGATE is defined. - bool b = __is_aggregate(void); - ((void)b); -#else -#error Forcing failure... -#endif - - return 0; -} diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp @@ -253,17 +253,11 @@ # error "__cpp_lib_integral_constant_callable should have the value 201304L in c++17" # endif -# if TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 -# ifndef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should be defined in c++17" -# endif -# if __cpp_lib_is_aggregate != 201703L -# error "__cpp_lib_is_aggregate should have the value 201703L in c++17" -# endif -# else -# ifdef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 is not defined!" -# endif +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++17" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++17" # endif # ifdef __cpp_lib_is_constant_evaluated @@ -389,17 +383,11 @@ # error "__cpp_lib_integral_constant_callable should have the value 201304L in c++20" # endif -# if TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 -# ifndef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should be defined in c++20" -# endif -# if __cpp_lib_is_aggregate != 201703L -# error "__cpp_lib_is_aggregate should have the value 201703L in c++20" -# endif -# else -# ifdef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 is not defined!" -# endif +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++20" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++20" # endif # if TEST_HAS_BUILTIN(__builtin_is_constant_evaluated) || TEST_GCC_VER >= 900 @@ -558,17 +546,11 @@ # error "__cpp_lib_integral_constant_callable should have the value 201304L in c++2b" # endif -# if TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 -# ifndef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should be defined in c++2b" -# endif -# if __cpp_lib_is_aggregate != 201703L -# error "__cpp_lib_is_aggregate should have the value 201703L in c++2b" -# endif -# else -# ifdef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 is not defined!" -# endif +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++2b" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++2b" # endif # if TEST_HAS_BUILTIN(__builtin_is_constant_evaluated) || TEST_GCC_VER >= 900 diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp @@ -1660,17 +1660,11 @@ # error "__cpp_lib_invoke should have the value 201411L in c++17" # endif -# if TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 -# ifndef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should be defined in c++17" -# endif -# if __cpp_lib_is_aggregate != 201703L -# error "__cpp_lib_is_aggregate should have the value 201703L in c++17" -# endif -# else -# ifdef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 is not defined!" -# endif +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++17" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++17" # endif # ifdef __cpp_lib_is_constant_evaluated @@ -2694,17 +2688,11 @@ # error "__cpp_lib_invoke should have the value 201411L in c++20" # endif -# if TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 -# ifndef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should be defined in c++20" -# endif -# if __cpp_lib_is_aggregate != 201703L -# error "__cpp_lib_is_aggregate should have the value 201703L in c++20" -# endif -# else -# ifdef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 is not defined!" -# endif +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++20" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++20" # endif # if TEST_HAS_BUILTIN(__builtin_is_constant_evaluated) || TEST_GCC_VER >= 900 @@ -3875,17 +3863,11 @@ # error "__cpp_lib_invoke should have the value 201411L in c++2b" # endif -# if TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 -# ifndef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should be defined in c++2b" -# endif -# if __cpp_lib_is_aggregate != 201703L -# error "__cpp_lib_is_aggregate should have the value 201703L in c++2b" -# endif -# else -# ifdef __cpp_lib_is_aggregate -# error "__cpp_lib_is_aggregate should not be defined when TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001 is not defined!" -# endif +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++2b" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++2b" # endif # if TEST_HAS_BUILTIN(__builtin_is_constant_evaluated) || TEST_GCC_VER >= 900 diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_aggregate.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_aggregate.pass.cpp --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_aggregate.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_aggregate.pass.cpp @@ -19,7 +19,6 @@ 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, ""); @@ -28,13 +27,11 @@ 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, ""); @@ -43,7 +40,6 @@ static_assert(!std::is_aggregate_v, ""); static_assert(!std::is_aggregate_v, ""); static_assert(!std::is_aggregate_v, ""); -#endif } struct Aggregate {}; diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -363,8 +363,6 @@ "name": "__cpp_lib_is_aggregate", "values": { "c++17": 201703 }, "headers": ["type_traits"], - "test_suite_guard": "TEST_HAS_BUILTIN_IDENTIFIER(__is_aggregate) || TEST_GCC_VER_NEW >= 7001", - "libcxx_guard": "!defined(_LIBCPP_HAS_NO_IS_AGGREGATE)", }, { "name": "__cpp_lib_is_constant_evaluated", "values": { "c++20": 201811 },