diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -99,7 +99,7 @@ template struct is_trivial; template struct is_trivially_copyable; template struct is_standard_layout; - template struct is_literal_type; + template struct is_literal_type; // Deprecated in C++17; removed in C++20 template struct is_empty; template struct is_polymorphic; template struct is_abstract; @@ -3717,7 +3717,9 @@ // is_literal_type; -template struct _LIBCPP_TEMPLATE_VIS is_literal_type +#if _LIBCPP_STD_VER <= 17 + +template struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 is_literal_type : public integral_constant {}; @@ -3727,6 +3729,8 @@ = is_literal_type<_Tp>::value; #endif +#endif + // is_standard_layout; template struct _LIBCPP_TEMPLATE_VIS is_standard_layout diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp @@ -13,6 +13,9 @@ // constexpr atomic::atomic(T value) +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #include #include #include @@ -35,7 +38,9 @@ struct TestFunc { void operator()() const { typedef std::atomic Atomic; +#if TEST_STD_VER <= 17 static_assert(std::is_literal_type::value, ""); +#endif constexpr Tp t(42); { constexpr Atomic a(t); diff --git a/libcxx/test/std/utilities/any/any.class/not_literal_type.pass.cpp b/libcxx/test/std/utilities/any/any.class/not_literal_type.pass.cpp --- a/libcxx/test/std/utilities/any/any.class/not_literal_type.pass.cpp +++ b/libcxx/test/std/utilities/any/any.class/not_literal_type.pass.cpp @@ -6,12 +6,15 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14 +// REQUIRES: c++17 // // [Note any is a not a literal type --end note] +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #include #include diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp @@ -6,10 +6,15 @@ // //===----------------------------------------------------------------------===// +// REQUIRES: c++11, c++14, c++17 + // type_traits // is_literal_type +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #include #include // for std::nullptr_t #include "test_macros.h" diff --git a/libcxx/test/std/utilities/any/any.class/not_literal_type.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.removed.verify.cpp copy from libcxx/test/std/utilities/any/any.class/not_literal_type.pass.cpp copy to libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.removed.verify.cpp --- a/libcxx/test/std/utilities/any/any.class/not_literal_type.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.removed.verify.cpp @@ -6,19 +6,16 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14 +// REQUIRES: c++20 -// +// type_traits -// [Note any is a not a literal type --end note] +// is_literal_type -#include -#include - -#include "test_macros.h" +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -int main(int, char**) { - static_assert(!std::is_literal_type::value, ""); +#include - return 0; -} +using std::is_literal_type; // expected-error {{no member named 'is_literal_type' in namespace 'std'}} +using std::is_literal_type_v; // expected-error {{no member named 'is_literal_type_v' in namespace 'std'}} diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp --- a/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp @@ -11,6 +11,9 @@ // ~optional(); +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #include #include #include @@ -40,25 +43,33 @@ typedef int T; static_assert(std::is_trivially_destructible::value, ""); static_assert(std::is_trivially_destructible>::value, ""); +#if TEST_STD_VER <= 17 static_assert(std::is_literal_type>::value, ""); +#endif } { typedef double T; static_assert(std::is_trivially_destructible::value, ""); static_assert(std::is_trivially_destructible>::value, ""); +#if TEST_STD_VER <= 17 static_assert(std::is_literal_type>::value, ""); +#endif } { typedef PODType T; static_assert(std::is_trivially_destructible::value, ""); static_assert(std::is_trivially_destructible>::value, ""); +#if TEST_STD_VER <= 17 static_assert(std::is_literal_type>::value, ""); +#endif } { typedef X T; static_assert(!std::is_trivially_destructible::value, ""); static_assert(!std::is_trivially_destructible>::value, ""); +#if TEST_STD_VER <= 17 static_assert(!std::is_literal_type>::value, ""); +#endif { X x; optional opt{x};