[libcxx-commits] [libcxx] 8a6b44b - Revert "[libc++] Fix tests for clang::no_specializations for C++17 and C++20"
Thurston Dang via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jan 24 19:56:41 PST 2025
Author: Thurston Dang
Date: 2025-01-25T03:55:09Z
New Revision: 8a6b44bf4cfe5df3db687a6b9519e99dbce8cf54
URL: https://github.com/llvm/llvm-project/commit/8a6b44bf4cfe5df3db687a6b9519e99dbce8cf54
DIFF: https://github.com/llvm/llvm-project/commit/8a6b44bf4cfe5df3db687a6b9519e99dbce8cf54.diff
LOG: Revert "[libc++] Fix tests for clang::no_specializations for C++17 and C++20"
This reverts commit 4df9c17e5f436702ca4f5439322972b0385d629a.
Reason: buildbot breakage
(https://lab.llvm.org/buildbot/#/builders/24/builds/4598/steps/10/logs/stdio)
Added:
Modified:
libcxx/include/__type_traits/result_of.h
libcxx/test/libcxx/ranges/no_specializations.verify.cpp
libcxx/test/libcxx/type_traits/no_specializations.verify.cpp
Removed:
################################################################################
diff --git a/libcxx/include/__type_traits/result_of.h b/libcxx/include/__type_traits/result_of.h
index 8cc009dbe8baa8..217ca70b4cd207 100644
--- a/libcxx/include/__type_traits/result_of.h
+++ b/libcxx/include/__type_traits/result_of.h
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
template <class _Callable>
-struct _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS result_of;
+struct _LIBCPP_DEPRECATED_IN_CXX17 result_of;
template <class _Fp, class... _Args>
struct _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)> : __invoke_result<_Fp, _Args...> {};
diff --git a/libcxx/test/libcxx/ranges/no_specializations.verify.cpp b/libcxx/test/libcxx/ranges/no_specializations.verify.cpp
index 489e3a6a73744f..69d458a9205583 100644
--- a/libcxx/test/libcxx/ranges/no_specializations.verify.cpp
+++ b/libcxx/test/libcxx/ranges/no_specializations.verify.cpp
@@ -13,9 +13,7 @@
#include <ranges>
-#include "test_macros.h"
-
-#if !__has_warning("-Winvalid-specialization") || TEST_STD_VER <= 20
+#if !__has_warning("-Winvalid-specialization")
// expected-no-diagnostics
#else
struct S {};
diff --git a/libcxx/test/libcxx/type_traits/no_specializations.verify.cpp b/libcxx/test/libcxx/type_traits/no_specializations.verify.cpp
index 807d01e381b492..e6d960667e8c0c 100644
--- a/libcxx/test/libcxx/type_traits/no_specializations.verify.cpp
+++ b/libcxx/test/libcxx/type_traits/no_specializations.verify.cpp
@@ -36,22 +36,15 @@ SPECIALIZE_TRAIT(make_unsigned); // expected-error {{cannot be specialize
SPECIALIZE_TRAIT(remove_all_extents); // expected-error {{cannot be specialized}}
SPECIALIZE_TRAIT(remove_const); // expected-error {{cannot be specialized}}
SPECIALIZE_TRAIT(remove_cv); // expected-error {{cannot be specialized}}
+SPECIALIZE_TRAIT(remove_cvref); // expected-error {{cannot be specialized}}
SPECIALIZE_TRAIT(remove_extent); // expected-error {{cannot be specialized}}
SPECIALIZE_TRAIT(remove_pointer); // expected-error {{cannot be specialized}}
SPECIALIZE_TRAIT(remove_reference); // expected-error {{cannot be specialized}}
SPECIALIZE_TRAIT(remove_volatile); // expected-error {{cannot be specialized}}
+SPECIALIZE_TRAIT(type_identity); // expected-error {{cannot be specialized}}
SPECIALIZE_TRAIT(underlying_type); // expected-error {{cannot be specialized}}
-
-# if TEST_STD_VER <= 17
-SPECIALIZE_TRAIT(result_of); // expected-error {{cannot be specialized}}
-# endif
-
-# if TEST_STD_VER >= 20
-SPECIALIZE_TRAIT(remove_cvref); // expected-error {{cannot be specialized}}
-SPECIALIZE_TRAIT(type_identity); // expected-error {{cannot be specialized}}
-SPECIALIZE_TRAIT(unwrap_reference); // expected-error {{cannot be specialized}}
-SPECIALIZE_TRAIT(unwrap_ref_decay); // expected-error {{cannot be specialized}}
-# endif
+SPECIALIZE_TRAIT(unwrap_reference); // expected-error {{cannot be specialized}}
+SPECIALIZE_TRAIT(unwrap_ref_decay); // expected-error {{cannot be specialized}}
# undef SPECIALIZE_TRAIT
# define SPECIALIZE_UTT(Trait) \
@@ -103,6 +96,7 @@ SPECIALIZE_UTT(is_move_assignable); // expected-error 2 {{cannot
SPECIALIZE_UTT(is_move_constructible); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_BTT(is_nothrow_assignable); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_nothrow_constructible); // expected-error 2 {{cannot be specialized}}
+SPECIALIZE_BTT(is_nothrow_convertible); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_nothrow_copy_assignable); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_nothrow_copy_constructible); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_nothrow_default_constructible); // expected-error 2 {{cannot be specialized}}
@@ -136,6 +130,7 @@ SPECIALIZE_UTT(is_trivially_default_constructible); // expected-error 2 {{cannot
SPECIALIZE_UTT(is_trivially_destructible); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_trivially_move_assignable); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_trivially_move_constructible); // expected-error 2 {{cannot be specialized}}
+SPECIALIZE_UTT(is_unbounded_array); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_union); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_unsigned); // expected-error 2 {{cannot be specialized}}
SPECIALIZE_UTT(is_void); // expected-error 2 {{cannot be specialized}}
@@ -145,12 +140,11 @@ SPECIALIZE_UTT(rank); // expected-error 2 {{cannot
# if TEST_STD_VER <= 17
SPECIALIZE_UTT(is_literal_type); // expected-error 2 {{cannot be specialized}}
+SPECIALIZE_UTT(result_of); // expected-error 2 {{cannot be specialized}}
# endif
# if TEST_STD_VER >= 20
-SPECIALIZE_UTT(is_bounded_array); // expected-error 2 {{cannot be specialized}}
-SPECIALIZE_BTT(is_nothrow_convertible); // expected-error 2 {{cannot be specialized}}
-SPECIALIZE_UTT(is_unbounded_array); // expected-error 2 {{cannot be specialized}}
+SPECIALIZE_UTT(is_bounded_array); // expected-error 2 {{cannot be specialized}}
# endif
# if TEST_STD_VER >= 23
@@ -177,8 +171,6 @@ struct std::conditional<true, S, S>; // expected-error {{cannot be specialized}}
template <>
struct std::enable_if<true, S>; // expected-error {{cannot be specialized}}
-#if TEST_STD_VER >= 20
template <>
struct std::integral_constant<S, {}>; // expected-error {{cannot be specialized}}
#endif
-#endif
More information about the libcxx-commits
mailing list