[libcxx-commits] [libcxx] [libc++] Fix LLVM 22 TODOs (PR #153367)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 14 04:44:30 PDT 2025
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/153367
>From 7d959c3a42d09ecd5bd124cc7f194ca580a3ab54 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Wed, 13 Aug 2025 10:10:02 +0200
Subject: [PATCH] [libc++] Fix LLVM 22 TODOs
---
.../referenceable.h} | 20 +-
libcxx/include/__config | 13 -
libcxx/include/__configuration/abi.h | 8 -
libcxx/include/__format/format_arg.h | 17 +-
libcxx/include/__format/format_context.h | 4 +-
libcxx/include/__hash_table | 12 -
libcxx/include/__iterator/concepts.h | 15 +-
libcxx/include/__math/traits.h | 15 +-
libcxx/include/__ranges/transform_view.h | 2 +-
libcxx/include/__tree | 12 -
libcxx/include/__type_traits/add_pointer.h | 25 --
.../reference_constructs_from_temporary.h | 6 -
libcxx/include/__type_traits/remove_pointer.h | 13 -
libcxx/include/forward_list | 11 -
libcxx/include/list | 11 -
libcxx/include/tuple | 4 +-
libcxx/include/variant | 2 +-
.../c.math/constexpr-cxx23-clang.pass.cpp | 7 -
.../transform_error.mandates.verify.cpp | 27 +-
.../transform_error.mandates.verify.cpp | 27 +-
.../meta/is_referenceable.compile.pass.cpp | 234 +++++++++---------
.../format.arg/visit_format_arg.pass.cpp | 6 +-
.../format.arguments/format.args/get.pass.cpp | 6 +-
...855_tuple_ref_binding_diagnostics.pass.cpp | 22 --
libcxx/test/support/test_basic_format_arg.h | 2 +-
libcxx/test/support/test_macros.h | 7 -
26 files changed, 168 insertions(+), 360 deletions(-)
rename libcxx/include/{__type_traits/is_referenceable.h => __concepts/referenceable.h} (61%)
diff --git a/libcxx/include/__type_traits/is_referenceable.h b/libcxx/include/__concepts/referenceable.h
similarity index 61%
rename from libcxx/include/__type_traits/is_referenceable.h
rename to libcxx/include/__concepts/referenceable.h
index 3a9d2858ba4c9..d8b64d9e703d3 100644
--- a/libcxx/include/__type_traits/is_referenceable.h
+++ b/libcxx/include/__concepts/referenceable.h
@@ -6,29 +6,27 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
+#ifndef _LIBCPP___CONCEPTS_REFERENCEABLE_H
+#define _LIBCPP___CONCEPTS_REFERENCEABLE_H
#include <__config>
-#include <__type_traits/void_t.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
-_LIBCPP_BEGIN_NAMESPACE_STD
+#if _LIBCPP_STD_VER >= 20
-template <class _Tp, class = void>
-inline const bool __is_referenceable_v = false;
+_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-inline const bool __is_referenceable_v<_Tp, __void_t<_Tp&> > = true;
+using __with_reference = _Tp&;
-#if _LIBCPP_STD_VER >= 20
template <class _Tp>
-concept __referenceable = __is_referenceable_v<_Tp>;
-#endif
+concept __referenceable = requires { typename __with_reference<_Tp>; };
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
+#endif
+
+#endif // _LIBCPP___CONCEPTS_REFERENCEABLE_H
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 77a71b6cf1cae..f9b8eb6f50f96 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1050,11 +1050,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
# endif
-// TODO(LLVM 22): Remove the workaround
-# if defined(__OBJC__) && (!defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER < 2001)
-# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS
-# endif
-
# define _PSTL_PRAGMA(x) _Pragma(#x)
// Enable SIMD for compilers that support OpenMP 4.0
@@ -1254,14 +1249,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_DIAGNOSE_NULLPTR
# endif
-// TODO(LLVM 22): Remove this macro once LLVM19 support ends. __cpp_explicit_this_parameter has been set in LLVM20.
-// Clang-18 has support for deducing this, but it does not set the FTM.
-# if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1800)
-# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 1
-# else
-# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 0
-# endif
-
#endif // __cplusplus
#endif // _LIBCPP___CONFIG
diff --git a/libcxx/include/__configuration/abi.h b/libcxx/include/__configuration/abi.h
index a75cd0a675339..5cc601c91c47c 100644
--- a/libcxx/include/__configuration/abi.h
+++ b/libcxx/include/__configuration/abi.h
@@ -49,14 +49,6 @@
// According to the Standard, `bitset::operator[] const` returns bool
# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
-// In LLVM 20, we've changed to take these ABI breaks unconditionally. These flags only exist in case someone is running
-// into the static_asserts we added to catch the ABI break and don't care that it is one.
-// TODO(LLVM 22): Remove these flags
-# define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
-# define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
-# define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
-# define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
-
// These flags are documented in ABIGuarantees.rst
# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
# define _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON
diff --git a/libcxx/include/__format/format_arg.h b/libcxx/include/__format/format_arg.h
index ed5e76275ea87..19794f0f084ce 100644
--- a/libcxx/include/__format/format_arg.h
+++ b/libcxx/include/__format/format_arg.h
@@ -149,7 +149,7 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) __visit_format_arg(_Visitor&& __vis, basic_
__libcpp_unreachable();
}
-# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# if _LIBCPP_STD_VER >= 26
template <class _Rp, class _Visitor, class _Context>
_LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
@@ -200,7 +200,7 @@ _LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<
__libcpp_unreachable();
}
-# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# endif // _LIBCPP_STD_VER >= 26
/// Contains the values used in basic_format_arg.
///
@@ -285,7 +285,7 @@ class _LIBCPP_NO_SPECIALIZATIONS basic_format_arg {
_LIBCPP_HIDE_FROM_ABI explicit operator bool() const noexcept { return __type_ != __format::__arg_t::__none; }
-# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# if _LIBCPP_STD_VER >= 26
// This function is user facing, so it must wrap the non-standard types of
// the "variant" in a handle to stay conforming. See __arg_t for more details.
@@ -329,7 +329,7 @@ class _LIBCPP_NO_SPECIALIZATIONS basic_format_arg {
}
}
-# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# endif // _LIBCPP_STD_VER >= 26
private:
using char_type = typename _Context::char_type;
@@ -371,11 +371,8 @@ class basic_format_arg<_Context>::handle {
// This function is user facing, so it must wrap the non-standard types of
// the "variant" in a handle to stay conforming. See __arg_t for more details.
template <class _Visitor, class _Context>
-# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
-_LIBCPP_DEPRECATED_IN_CXX26
-# endif
- _LIBCPP_HIDE_FROM_ABI decltype(auto)
- visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
+_LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_HIDE_FROM_ABI decltype(auto)
+visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
switch (__arg.__type_) {
# if _LIBCPP_HAS_INT128
case __format::__arg_t::__i128: {
@@ -387,7 +384,7 @@ _LIBCPP_DEPRECATED_IN_CXX26
typename __basic_format_arg_value<_Context>::__handle __h{__arg.__value_.__u128_};
return std::invoke(std::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
}
-# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# endif // _LIBCPP_HAS_INT128
default:
return std::__visit_format_arg(std::forward<_Visitor>(__vis), __arg);
}
diff --git a/libcxx/include/__format/format_context.h b/libcxx/include/__format/format_context.h
index e672ee7ad0581..1771dd34b82fb 100644
--- a/libcxx/include/__format/format_context.h
+++ b/libcxx/include/__format/format_context.h
@@ -175,13 +175,13 @@ class basic_format_context<typename __format::__retarget_buffer<_CharT>::__itera
__format::__determine_arg_t<basic_format_context, decltype(__arg)>(),
__basic_format_arg_value<basic_format_context>(__arg)};
};
-# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# if _LIBCPP_STD_VER >= 26
return static_cast<_Context*>(__c)->arg(__id).visit(std::move(__visitor));
# else
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
return std::visit_format_arg(std::move(__visitor), static_cast<_Context*>(__c)->arg(__id));
_LIBCPP_SUPPRESS_DEPRECATED_POP
-# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# endif // _LIBCPP_STD_VER >= 26
}) {
}
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index dacc152030e14..073617f750b76 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -81,18 +81,6 @@ struct __hash_node_base {
typedef _NodePtr __node_pointer;
typedef __node_base_pointer __next_pointer;
-// TODO(LLVM 22): Remove this check
-#ifndef _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
- static_assert(sizeof(__node_base_pointer) == sizeof(__node_pointer) && _LIBCPP_ALIGNOF(__node_base_pointer) ==
- _LIBCPP_ALIGNOF(__node_pointer),
- "It looks like you are using std::__hash_table (an implementation detail for the unordered containers) "
- "with a fancy pointer type that thas a different representation depending on whether it points to a "
- "__hash_table base pointer or a __hash_table node pointer (both of which are implementation details of "
- "the standard library). This means that your ABI is being broken between LLVM 19 and LLVM 20. If you "
- "don't care about your ABI being broken, define the _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB macro to "
- "silence this diagnostic.");
-#endif
-
__next_pointer __next_;
_LIBCPP_HIDE_FROM_ABI __next_pointer __ptr() _NOEXCEPT {
diff --git a/libcxx/include/__iterator/concepts.h b/libcxx/include/__iterator/concepts.h
index 20a1ab4691100..3b43920443636 100644
--- a/libcxx/include/__iterator/concepts.h
+++ b/libcxx/include/__iterator/concepts.h
@@ -117,15 +117,12 @@ template <class _Tp>
concept __signed_integer_like = signed_integral<_Tp>;
template <class _Ip>
-concept weakly_incrementable =
- // TODO: remove this once the clang bug is fixed (bugs.llvm.org/PR48173).
- !same_as<_Ip, bool> && // Currently, clang does not handle bool correctly.
- movable<_Ip> && requires(_Ip __i) {
- typename iter_difference_t<_Ip>;
- requires __signed_integer_like<iter_difference_t<_Ip>>;
- { ++__i } -> same_as<_Ip&>; // not required to be equality-preserving
- __i++; // not required to be equality-preserving
- };
+concept weakly_incrementable = movable<_Ip> && requires(_Ip __i) {
+ typename iter_difference_t<_Ip>;
+ requires __signed_integer_like<iter_difference_t<_Ip>>;
+ { ++__i } -> same_as<_Ip&>; // not required to be equality-preserving
+ __i++; // not required to be equality-preserving
+};
// [iterator.concept.inc]
template <class _Ip>
diff --git a/libcxx/include/__math/traits.h b/libcxx/include/__math/traits.h
index 00db2a8289fb3..ff22cee7305d7 100644
--- a/libcxx/include/__math/traits.h
+++ b/libcxx/include/__math/traits.h
@@ -25,33 +25,26 @@ namespace __math {
// signbit
-// TODO(LLVM 22): Remove conditional once support for Clang 19 is dropped.
-#if defined(_LIBCPP_COMPILER_GCC) || __has_constexpr_builtin(__builtin_signbit)
-# define _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_CONSTEXPR_SINCE_CXX23
-#else
-# define _LIBCPP_SIGNBIT_CONSTEXPR
-#endif
-
// The universal C runtime (UCRT) in the WinSDK provides floating point overloads
// for std::signbit(). By defining our overloads as templates, we can work around
// this issue as templates are less preferred than non-template functions.
template <class = void>
-[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(float __x) _NOEXCEPT {
+[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(float __x) _NOEXCEPT {
return __builtin_signbit(__x);
}
template <class = void>
-[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(double __x) _NOEXCEPT {
+[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(double __x) _NOEXCEPT {
return __builtin_signbit(__x);
}
template <class = void>
-[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(long double __x) _NOEXCEPT {
+[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(long double __x) _NOEXCEPT {
return __builtin_signbit(__x);
}
template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
-[[__nodiscard__]] inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT {
+[[__nodiscard__]] inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT {
return __x < 0;
}
diff --git a/libcxx/include/__ranges/transform_view.h b/libcxx/include/__ranges/transform_view.h
index ae85dfa452d72..878db889d8d8b 100644
--- a/libcxx/include/__ranges/transform_view.h
+++ b/libcxx/include/__ranges/transform_view.h
@@ -64,7 +64,7 @@ concept __regular_invocable_with_range_ref = regular_invocable<_Fn, range_refere
template <class _View, class _Fn>
concept __transform_view_constraints =
view<_View> && is_object_v<_Fn> && regular_invocable<_Fn&, range_reference_t<_View>> &&
- __is_referenceable_v<invoke_result_t<_Fn&, range_reference_t<_View>>>;
+ __referenceable<invoke_result_t<_Fn&, range_reference_t<_View>>>;
# if _LIBCPP_STD_VER >= 23
template <input_range _View, move_constructible _Fn>
diff --git a/libcxx/include/__tree b/libcxx/include/__tree
index 6dadd0915c984..f508f3ae7a254 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -766,18 +766,6 @@ public:
typedef __rebind_alloc<__alloc_traits, __node> __node_allocator;
typedef allocator_traits<__node_allocator> __node_traits;
-// TODO(LLVM 22): Remove this check
-#ifndef _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
- static_assert(sizeof(__node_base_pointer) == sizeof(__end_node_pointer) && _LIBCPP_ALIGNOF(__node_base_pointer) ==
- _LIBCPP_ALIGNOF(__end_node_pointer),
- "It looks like you are using std::__tree (an implementation detail for (multi)map/set) with a fancy "
- "pointer type that thas a different representation depending on whether it points to a __tree base "
- "pointer or a __tree node pointer (both of which are implementation details of the standard library). "
- "This means that your ABI is being broken between LLVM 19 and LLVM 20. If you don't care about your "
- "ABI being broken, define the _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB macro to silence this "
- "diagnostic.");
-#endif
-
private:
// check for sane allocator pointer rebinding semantics. Rebinding the
// allocator for a new pointer type should be exactly the same as rebinding
diff --git a/libcxx/include/__type_traits/add_pointer.h b/libcxx/include/__type_traits/add_pointer.h
index fa9376699a74a..781187c48a8a8 100644
--- a/libcxx/include/__type_traits/add_pointer.h
+++ b/libcxx/include/__type_traits/add_pointer.h
@@ -10,9 +10,6 @@
#define _LIBCPP___TYPE_TRAITS_ADD_POINTER_H
#include <__config>
-#include <__type_traits/is_referenceable.h>
-#include <__type_traits/is_void.h>
-#include <__type_traits/remove_reference.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -20,8 +17,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS)
-
template <class _Tp>
struct _LIBCPP_NO_SPECIALIZATIONS add_pointer {
using type _LIBCPP_NODEBUG = __add_pointer(_Tp);
@@ -35,26 +30,6 @@ template <class _Tp>
using __add_pointer_t _LIBCPP_NODEBUG = __add_pointer(_Tp);
# endif
-#else
-template <class _Tp, bool = __is_referenceable_v<_Tp> || is_void<_Tp>::value>
-struct __add_pointer_impl {
- using type _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tp>*;
-};
-template <class _Tp>
-struct __add_pointer_impl<_Tp, false> {
- using type _LIBCPP_NODEBUG = _Tp;
-};
-
-template <class _Tp>
-using __add_pointer_t = typename __add_pointer_impl<_Tp>::type;
-
-template <class _Tp>
-struct _LIBCPP_NO_SPECIALIZATIONS add_pointer {
- using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
-};
-
-#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS)
-
#if _LIBCPP_STD_VER >= 14
template <class _Tp>
using add_pointer_t = __add_pointer_t<_Tp>;
diff --git a/libcxx/include/__type_traits/reference_constructs_from_temporary.h b/libcxx/include/__type_traits/reference_constructs_from_temporary.h
index 2ff549b4e15ce..3d097ce90cb09 100644
--- a/libcxx/include/__type_traits/reference_constructs_from_temporary.h
+++ b/libcxx/include/__type_traits/reference_constructs_from_temporary.h
@@ -30,14 +30,8 @@ _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool reference_constructs_from_tempo
#endif
-#if __has_builtin(__reference_constructs_from_temporary)
template <class _Tp, class _Up>
inline const bool __reference_constructs_from_temporary_v = __reference_constructs_from_temporary(_Tp, _Up);
-#else
-// TODO(LLVM 22): Remove this as all supported compilers should have __reference_constructs_from_temporary implemented.
-template <class _Tp, class _Up>
-inline const bool __reference_constructs_from_temporary_v = __reference_binds_to_temporary(_Tp, _Up);
-#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__type_traits/remove_pointer.h b/libcxx/include/__type_traits/remove_pointer.h
index 975ed43047dee..16898e3c21ce6 100644
--- a/libcxx/include/__type_traits/remove_pointer.h
+++ b/libcxx/include/__type_traits/remove_pointer.h
@@ -17,7 +17,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)
template <class _Tp>
struct _LIBCPP_NO_SPECIALIZATIONS remove_pointer {
using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
@@ -30,18 +29,6 @@ using __remove_pointer_t _LIBCPP_NODEBUG = typename remove_pointer<_Tp>::type;
template <class _Tp>
using __remove_pointer_t _LIBCPP_NODEBUG = __remove_pointer(_Tp);
# endif
-#else
-// clang-format off
-template <class _Tp> struct remove_pointer {using type _LIBCPP_NODEBUG = _Tp;};
-template <class _Tp> struct remove_pointer<_Tp*> {using type _LIBCPP_NODEBUG = _Tp;};
-template <class _Tp> struct remove_pointer<_Tp* const> {using type _LIBCPP_NODEBUG = _Tp;};
-template <class _Tp> struct remove_pointer<_Tp* volatile> {using type _LIBCPP_NODEBUG = _Tp;};
-template <class _Tp> struct remove_pointer<_Tp* const volatile> {using type _LIBCPP_NODEBUG = _Tp;};
-// clang-format on
-
-template <class _Tp>
-using __remove_pointer_t = typename remove_pointer<_Tp>::type;
-#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)
#if _LIBCPP_STD_VER >= 14
template <class _Tp>
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 6daa7fbbc03c2..2380aadf9e86c 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -283,17 +283,6 @@ struct __forward_node_traits {
typedef _NodePtr __node_pointer;
typedef __forward_begin_node<_NodePtr> __begin_node;
typedef __rebind_pointer_t<_NodePtr, __begin_node> __begin_node_pointer;
-
-// TODO(LLVM 22): Remove this check
-# ifndef _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
- static_assert(sizeof(__begin_node_pointer) == sizeof(__node_pointer) && _LIBCPP_ALIGNOF(__begin_node_pointer) ==
- _LIBCPP_ALIGNOF(__node_pointer),
- "It looks like you are using std::forward_list with a fancy pointer type that thas a different "
- "representation depending on whether it points to a forward_list base pointer or a forward_list node "
- "pointer (both of which are implementation details of the standard library). This means that your ABI "
- "is being broken between LLVM 19 and LLVM 20. If you don't care about your ABI being broken, define "
- "the _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB macro to silence this diagnostic.");
-# endif
};
template <class _NodePtr>
diff --git a/libcxx/include/list b/libcxx/include/list
index 2896231203d9b..f04f43b69564b 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -275,17 +275,6 @@ template <class _Tp, class _VoidPtr>
struct __list_node_pointer_traits {
typedef __rebind_pointer_t<_VoidPtr, __list_node<_Tp, _VoidPtr> > __node_pointer;
typedef __rebind_pointer_t<_VoidPtr, __list_node_base<_Tp, _VoidPtr> > __base_pointer;
-
-// TODO(LLVM 22): Remove this check
-# ifndef _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
- static_assert(sizeof(__node_pointer) == sizeof(__node_pointer) && _LIBCPP_ALIGNOF(__base_pointer) ==
- _LIBCPP_ALIGNOF(__node_pointer),
- "It looks like you are using std::list with a fancy pointer type that thas a different representation "
- "depending on whether it points to a list base pointer or a list node pointer (both of which are "
- "implementation details of the standard library). This means that your ABI is being broken between "
- "LLVM 19 and LLVM 20. If you don't care about your ABI being broken, define the "
- "_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB macro to silence this diagnostic.");
-# endif
};
template <class _Tp, class _VoidPtr>
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index be30ab5b2173d..e8430f0dd0742 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -303,7 +303,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool __tuple_compare_equal(c
template <class _Tp, class _Up, class _IndexSeq = make_index_sequence<tuple_size_v<_Tp>>>
inline constexpr bool __can_tuple_compare_equal = false;
-// TODO(LLVM 22): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
+// TODO(LLVM 23): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
// because the resolution of CWG2369 landed in LLVM-21.
template <class _Tp, class _Up, size_t... _Is>
requires(tuple_size_v<_Tp> == tuple_size_v<_Up>)
@@ -336,7 +336,7 @@ concept __tuple_like_no_tuple = __tuple_like<_Tp> && !__is_tuple_v<_Tp>;
template <class _Tp, class _Up, class _IndexSeq>
struct __tuple_common_comparison_category_impl {};
-// TODO(LLVM 22): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
+// TODO(LLVM 23): Remove `tuple_size_v<_Tp> == tuple_size_v<_Up>` here once once LLVM-20 support ends
// because the resolution of CWG2369 landed in LLVM-21.
template <class _Tp, class _Up, size_t... _Is>
requires(tuple_size_v<_Tp> == tuple_size_v<_Up>) && requires {
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 9beef146f203c..8e958581a6b07 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -1299,7 +1299,7 @@ public:
__impl_.__swap(__that.__impl_);
}
-# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+# if _LIBCPP_STD_VER >= 26
// Helper class to implement [variant.visit]/10
// Constraints: The call to visit does not use an explicit template-argument-list
// that begins with a type template-argument.
diff --git a/libcxx/test/libcxx/numerics/c.math/constexpr-cxx23-clang.pass.cpp b/libcxx/test/libcxx/numerics/c.math/constexpr-cxx23-clang.pass.cpp
index 3f17f21e8c108..20887b8cf2678 100644
--- a/libcxx/test/libcxx/numerics/c.math/constexpr-cxx23-clang.pass.cpp
+++ b/libcxx/test/libcxx/numerics/c.math/constexpr-cxx23-clang.pass.cpp
@@ -220,16 +220,9 @@ int main(int, char**) {
ASSERT_CONSTEXPR_CXX23(std::isnormal(-1.0) == 1);
ASSERT_CONSTEXPR_CXX23(std::isnormal(-1.0L) == 1);
-// TODO(LLVM 22): Remove `__has_constexpr_builtin` conditional once support for Clang 19 is dropped.
-#if !__has_constexpr_builtin(__builtin_signbit)
- ASSERT_NOT_CONSTEXPR_CXX23(std::signbit(-1.0f) == 1);
- ASSERT_NOT_CONSTEXPR_CXX23(std::signbit(-1.0) == 1);
- ASSERT_NOT_CONSTEXPR_CXX23(std::signbit(-1.0L) == 1);
-#else
ASSERT_CONSTEXPR_CXX23(std::signbit(-1.0f) == 1);
ASSERT_CONSTEXPR_CXX23(std::signbit(-1.0) == 1);
ASSERT_CONSTEXPR_CXX23(std::signbit(-1.0L) == 1);
-#endif
ASSERT_NOT_CONSTEXPR_CXX23(std::isgreater(-1.0f, 0.0f) == 0);
ASSERT_NOT_CONSTEXPR_CXX23(std::isgreater(-1.0, 0.0) == 0);
diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp
index 25cc08a55a428..3e9bdd98cd394 100644
--- a/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp
+++ b/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp
@@ -8,15 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// With clang-cl, some warnings have a 'which is a Microsoft extension' suffix
-// which break the tests. But #102851 will turn it into an error, making the test pass.
-// However, upstream libcxx buildbots do not build clang from source while testing, so
-// this tests still expected to fail on these bots.
-//
-// TODO(LLVM 22): Remove '0-1' from 'expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}'
-// and remove 'expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}'
-// once LLVM 22 releases. See https://github.com/llvm/llvm-project/issues/104885.
-
// Test the mandates
// template<class F> constexpr auto transform_error(F&& f) &;
@@ -55,41 +46,39 @@ void test() {
{
std::expected<int, int> e;
e.transform_error(return_unexpected<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
- // expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
+ // expected-error-re@*:* {{union member {{.*}} has reference type {{.*}}}}
e.transform_error(return_no_object<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
- // expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
}
// Test const& overload
{
const std::expected<int, int> e;
e.transform_error(return_unexpected<const int &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
e.transform_error(return_no_object<const int &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
}
// Test && overload
{
std::expected<int, int> e;
std::move(e).transform_error(return_unexpected<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
std::move(e).transform_error(return_no_object<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
}
// Test const&& overload
{
const std::expected<int, int> e;
std::move(e).transform_error(return_unexpected<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
std::move(e).transform_error(return_no_object<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
}
}
// clang-format on
diff --git a/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp b/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp
index 2dd3acd51e6e6..c5acc27af03ea 100644
--- a/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp
+++ b/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp
@@ -8,16 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// With clang-cl, some warnings have a 'which is a Microsoft extension' suffix
-// which break the tests. But #102851 will turn it into an error, making the test pass.
-// However, upstream libcxx buildbots do not build clang from source while testing, so
-// this tests still expected to fail on these bots.
-//
-// TODO(LLVM 22): Remove '0-1' from 'expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}'
-// and remove 'expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}'
-// and remove 'expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}'
-// once LLVM 22 releases. See See https://github.com/llvm/llvm-project/issues/104885.
-
// Test the mandates
// template<class F> constexpr auto transform_error(F&& f) &;
@@ -56,43 +46,36 @@ void test() {
{
std::expected<void, int> e;
e.transform_error(return_unexpected<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
// expected-error-re@*:* {{static assertion failed {{.*}}A program that instantiates expected<T, E> with a E that is not a valid argument for unexpected<E> is ill-formed}}
- // expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
- // expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
+ // expected-error-re@*:* {{union member {{.*}} has reference type {{.*}}}}
e.transform_error(return_no_object<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
// expected-error-re@*:* {{static assertion failed {{.*}}A program that instantiates expected<T, E> with a E that is not a valid argument for unexpected<E> is ill-formed}}
- // expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
}
// Test const& overload
{
const std::expected<void, int> e;
e.transform_error(return_unexpected<const int &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
e.transform_error(return_no_object<const int &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
- // expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
+ // expected-error-re@*:* {{no matching constructor for initialization of{{.*}}}}
}
// Test && overload
{
std::expected<void, int> e;
std::move(e).transform_error(return_unexpected<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
std::move(e).transform_error(return_no_object<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
}
// Test const&& overload
{
const std::expected<void, int> e;
std::move(e).transform_error(return_unexpected<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
std::move(e).transform_error(return_no_object<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
- // expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
}
}
// clang-format on
diff --git a/libcxx/test/libcxx/utilities/meta/is_referenceable.compile.pass.cpp b/libcxx/test/libcxx/utilities/meta/is_referenceable.compile.pass.cpp
index 0991de69b5baf..47f7276b8e2e8 100644
--- a/libcxx/test/libcxx/utilities/meta/is_referenceable.compile.pass.cpp
+++ b/libcxx/test/libcxx/utilities/meta/is_referenceable.compile.pass.cpp
@@ -7,186 +7,186 @@
//===----------------------------------------------------------------------===//
//
-// __is_referenceable_v<Tp>
+// __referenceable<Tp>
//
// [defns.referenceable] defines "a referenceable type" as:
// An object type, a function type that does not have cv-qualifiers
// or a ref-qualifier, or a reference type.
//
-// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+// UNSUPPORTED: c++03, c++11, c++14, c++17
-#include <type_traits>
+#include <__concepts/referenceable.h>
#include <cassert>
#include "test_macros.h"
struct Foo {};
-static_assert((!std::__is_referenceable_v<void>), "");
-static_assert((std::__is_referenceable_v<int>), "");
-static_assert((std::__is_referenceable_v<int[3]>), "");
-static_assert((std::__is_referenceable_v<int[]>), "");
-static_assert((std::__is_referenceable_v<int&>), "");
-static_assert((std::__is_referenceable_v<const int&>), "");
-static_assert((std::__is_referenceable_v<int*>), "");
-static_assert((std::__is_referenceable_v<const int*>), "");
-static_assert((std::__is_referenceable_v<Foo>), "");
-static_assert((std::__is_referenceable_v<const Foo>), "");
-static_assert((std::__is_referenceable_v<Foo&>), "");
-static_assert((std::__is_referenceable_v<const Foo&>), "");
+static_assert((!std::__referenceable<void>));
+static_assert((std::__referenceable<int>));
+static_assert((std::__referenceable<int[3]>));
+static_assert((std::__referenceable<int[]>));
+static_assert((std::__referenceable<int&>));
+static_assert((std::__referenceable<const int&>));
+static_assert((std::__referenceable<int*>));
+static_assert((std::__referenceable<const int*>));
+static_assert((std::__referenceable<Foo>));
+static_assert((std::__referenceable<const Foo>));
+static_assert((std::__referenceable<Foo&>));
+static_assert((std::__referenceable<const Foo&>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<Foo&&>), "");
-static_assert((std::__is_referenceable_v<const Foo&&>), "");
+static_assert((std::__referenceable<Foo&&>));
+static_assert((std::__referenceable<const Foo&&>));
#endif
-static_assert((std::__is_referenceable_v<int __attribute__((__vector_size__(8)))>), "");
-static_assert((std::__is_referenceable_v<const int __attribute__((__vector_size__(8)))>), "");
-static_assert((std::__is_referenceable_v<float __attribute__((__vector_size__(16)))>), "");
-static_assert((std::__is_referenceable_v<const float __attribute__((__vector_size__(16)))>), "");
+static_assert((std::__referenceable<int __attribute__((__vector_size__(8)))>));
+static_assert((std::__referenceable<const int __attribute__((__vector_size__(8)))>));
+static_assert((std::__referenceable<float __attribute__((__vector_size__(16)))>));
+static_assert((std::__referenceable<const float __attribute__((__vector_size__(16)))>));
// Functions without cv-qualifiers are referenceable
-static_assert((std::__is_referenceable_v<void()>), "");
+static_assert((std::__referenceable<void()>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void() const>), "");
-static_assert((!std::__is_referenceable_v<void() &>), "");
-static_assert((!std::__is_referenceable_v<void() const&>), "");
-static_assert((!std::__is_referenceable_v<void() &&>), "");
-static_assert((!std::__is_referenceable_v<void() const&&>), "");
+static_assert((!std::__referenceable<void() const>));
+static_assert((!std::__referenceable<void() &>));
+static_assert((!std::__referenceable<void() const&>));
+static_assert((!std::__referenceable<void() &&>));
+static_assert((!std::__referenceable<void() const&&>));
#endif
-static_assert((std::__is_referenceable_v<void(int)>), "");
+static_assert((std::__referenceable<void(int)>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void(int) const>), "");
-static_assert((!std::__is_referenceable_v<void(int) &>), "");
-static_assert((!std::__is_referenceable_v<void(int) const&>), "");
-static_assert((!std::__is_referenceable_v<void(int) &&>), "");
-static_assert((!std::__is_referenceable_v<void(int) const&&>), "");
+static_assert((!std::__referenceable<void(int) const>));
+static_assert((!std::__referenceable<void(int) &>));
+static_assert((!std::__referenceable<void(int) const&>));
+static_assert((!std::__referenceable<void(int) &&>));
+static_assert((!std::__referenceable<void(int) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void(int, float)>), "");
+static_assert((std::__referenceable<void(int, float)>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void(int, float) const>), "");
-static_assert((!std::__is_referenceable_v<void(int, float) &>), "");
-static_assert((!std::__is_referenceable_v<void(int, float) const&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float) &&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float) const&&>), "");
+static_assert((!std::__referenceable<void(int, float) const>));
+static_assert((!std::__referenceable<void(int, float) &>));
+static_assert((!std::__referenceable<void(int, float) const&>));
+static_assert((!std::__referenceable<void(int, float) &&>));
+static_assert((!std::__referenceable<void(int, float) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void(int, float, Foo&)>), "");
+static_assert((std::__referenceable<void(int, float, Foo&)>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&) const>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&) &>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&) const&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&) &&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&) const&&>), "");
+static_assert((!std::__referenceable<void(int, float, Foo&) const>));
+static_assert((!std::__referenceable<void(int, float, Foo&) &>));
+static_assert((!std::__referenceable<void(int, float, Foo&) const&>));
+static_assert((!std::__referenceable<void(int, float, Foo&) &&>));
+static_assert((!std::__referenceable<void(int, float, Foo&) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void(...)>), "");
+static_assert((std::__referenceable<void(...)>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void(...) const>), "");
-static_assert((!std::__is_referenceable_v<void(...) &>), "");
-static_assert((!std::__is_referenceable_v<void(...) const&>), "");
-static_assert((!std::__is_referenceable_v<void(...) &&>), "");
-static_assert((!std::__is_referenceable_v<void(...) const&&>), "");
+static_assert((!std::__referenceable<void(...) const>));
+static_assert((!std::__referenceable<void(...) &>));
+static_assert((!std::__referenceable<void(...) const&>));
+static_assert((!std::__referenceable<void(...) &&>));
+static_assert((!std::__referenceable<void(...) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void(int, ...)>), "");
+static_assert((std::__referenceable<void(int, ...)>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void(int, ...) const>), "");
-static_assert((!std::__is_referenceable_v<void(int, ...) &>), "");
-static_assert((!std::__is_referenceable_v<void(int, ...) const&>), "");
-static_assert((!std::__is_referenceable_v<void(int, ...) &&>), "");
-static_assert((!std::__is_referenceable_v<void(int, ...) const&&>), "");
+static_assert((!std::__referenceable<void(int, ...) const>));
+static_assert((!std::__referenceable<void(int, ...) &>));
+static_assert((!std::__referenceable<void(int, ...) const&>));
+static_assert((!std::__referenceable<void(int, ...) &&>));
+static_assert((!std::__referenceable<void(int, ...) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void(int, float, ...)>), "");
+static_assert((std::__referenceable<void(int, float, ...)>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void(int, float, ...) const>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, ...) &>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, ...) const&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, ...) &&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, ...) const&&>), "");
+static_assert((!std::__referenceable<void(int, float, ...) const>));
+static_assert((!std::__referenceable<void(int, float, ...) &>));
+static_assert((!std::__referenceable<void(int, float, ...) const&>));
+static_assert((!std::__referenceable<void(int, float, ...) &&>));
+static_assert((!std::__referenceable<void(int, float, ...) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void(int, float, Foo&, ...)>), "");
+static_assert((std::__referenceable<void(int, float, Foo&, ...)>));
#if TEST_STD_VER >= 11
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) const>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) &>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) const&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) &&>), "");
-static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) const&&>), "");
+static_assert((!std::__referenceable<void(int, float, Foo&, ...) const>));
+static_assert((!std::__referenceable<void(int, float, Foo&, ...) &>));
+static_assert((!std::__referenceable<void(int, float, Foo&, ...) const&>));
+static_assert((!std::__referenceable<void(int, float, Foo&, ...) &&>));
+static_assert((!std::__referenceable<void(int, float, Foo&, ...) const&&>));
#endif
// member functions with or without cv-qualifiers are referenceable
-static_assert((std::__is_referenceable_v<void (Foo::*)()>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)() const>), "");
+static_assert((std::__referenceable<void (Foo::*)()>));
+static_assert((std::__referenceable<void (Foo::*)() const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)() &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)() const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)() &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)() const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)() &>));
+static_assert((std::__referenceable<void (Foo::*)() const&>));
+static_assert((std::__referenceable<void (Foo::*)() &&>));
+static_assert((std::__referenceable<void (Foo::*)() const&&>));
#endif
-static_assert((std::__is_referenceable_v<void (Foo::*)(int)>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int) const>), "");
+static_assert((std::__referenceable<void (Foo::*)(int)>));
+static_assert((std::__referenceable<void (Foo::*)(int) const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)(int) &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int) const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int) &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int) const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)(int) &>));
+static_assert((std::__referenceable<void (Foo::*)(int) const&>));
+static_assert((std::__referenceable<void (Foo::*)(int) &&>));
+static_assert((std::__referenceable<void (Foo::*)(int) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float)>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) const>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float)>));
+static_assert((std::__referenceable<void (Foo::*)(int, float) const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float) &>));
+static_assert((std::__referenceable<void (Foo::*)(int, float) const&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float) &&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&)>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) const>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&)>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&) const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&) &>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&) const&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&) &&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void (Foo::*)(...)>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(...) const>), "");
+static_assert((std::__referenceable<void (Foo::*)(...)>));
+static_assert((std::__referenceable<void (Foo::*)(...) const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)(...) &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(...) const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(...) &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(...) const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)(...) &>));
+static_assert((std::__referenceable<void (Foo::*)(...) const&>));
+static_assert((std::__referenceable<void (Foo::*)(...) &&>));
+static_assert((std::__referenceable<void (Foo::*)(...) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...)>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) const>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, ...)>));
+static_assert((std::__referenceable<void (Foo::*)(int, ...) const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, ...) &>));
+static_assert((std::__referenceable<void (Foo::*)(int, ...) const&>));
+static_assert((std::__referenceable<void (Foo::*)(int, ...) &&>));
+static_assert((std::__referenceable<void (Foo::*)(int, ...) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...)>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) const>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float, ...)>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, ...) const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float, ...) &>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, ...) const&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, ...) &&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, ...) const&&>));
#endif
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...)>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) const>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&, ...)>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&, ...) const>));
#if TEST_STD_VER >= 11
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) &>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) const&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) &&>), "");
-static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) const&&>), "");
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&, ...) &>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&, ...) const&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&, ...) &&>));
+static_assert((std::__referenceable<void (Foo::*)(int, float, Foo&, ...) const&&>));
#endif
diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
index d99675a71f321..9b7c8a7f4f8b4 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
@@ -9,6 +9,8 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
// <format>
// template<class Visitor, class Context>
@@ -25,10 +27,6 @@
#include "make_string.h"
#include "min_allocator.h"
-#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
-TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
-#endif
-
template <class Context, class To, class From>
void test(From value) {
auto store = std::make_format_args<Context>(value);
diff --git a/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
index c7dd82d726b3a..cbddc4f437a53 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
@@ -32,7 +32,7 @@ void test(From value) {
else
assert(false);
};
-#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
+#if TEST_STD_VER >= 26
format_args.get(0).visit(visitor);
#else
std::visit_format_arg(visitor, format_args.get(0));
@@ -47,7 +47,7 @@ void test_handle(T value) {
std::basic_format_args<Context> format_args{store};
auto visitor = [](auto a) { assert((std::is_same_v<decltype(a), typename std::basic_format_arg<Context>::handle>)); };
-#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
+#if TEST_STD_VER >= 26
format_args.get(0).visit(visitor);
#else
std::visit_format_arg(visitor, format_args.get(0));
@@ -73,7 +73,7 @@ void test_string_view(From value) {
else
assert(false);
};
-#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
+#if TEST_STD_VER >= 26
format_args.get(0).visit(visitor);
#else
std::visit_format_arg(visitor, format_args.get(0));
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
index d78de0eec8e53..0f6a6734264c3 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
@@ -16,17 +16,6 @@
#include <tuple>
#include <string>
#include <cassert>
-#include "test_macros.h"
-
-#if TEST_HAS_BUILTIN(__reference_constructs_from_temporary)
-# define ASSERT_REFERENCE_BINDS_TEMPORARY(...) static_assert(__reference_constructs_from_temporary(__VA_ARGS__), "")
-# define ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(...) \
- static_assert(!__reference_constructs_from_temporary(__VA_ARGS__), "")
-#else
-// TODO(LLVM 22): Remove this as all support compilers should have __reference_constructs_from_temporary implemented.
-# define ASSERT_REFERENCE_BINDS_TEMPORARY(...) static_assert(__reference_binds_to_temporary(__VA_ARGS__), "")
-# define ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(...) static_assert(!__reference_binds_to_temporary(__VA_ARGS__), "")
-#endif
template <class Tp>
struct ConvertsTo {
@@ -42,17 +31,6 @@ struct ConvertsTo {
struct Base {};
struct Derived : Base {};
-
-static_assert(std::is_same<decltype("abc"), decltype(("abc"))>::value, "");
-ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, decltype("abc"));
-ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, decltype(("abc")));
-ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, const char*&&);
-
-ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(int&, const ConvertsTo<int&>&);
-ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(const int&, ConvertsTo<int&>&);
-ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(Base&, Derived&);
-
-
static_assert(std::is_constructible<int&, std::reference_wrapper<int>>::value, "");
static_assert(std::is_constructible<int const&, std::reference_wrapper<int>>::value, "");
diff --git a/libcxx/test/support/test_basic_format_arg.h b/libcxx/test/support/test_basic_format_arg.h
index f51f6e97cbed0..99cd558c3c5bf 100644
--- a/libcxx/test/support/test_basic_format_arg.h
+++ b/libcxx/test/support/test_basic_format_arg.h
@@ -21,7 +21,7 @@ bool test_basic_format_arg(std::basic_format_arg<Context> arg, T expected) {
else
return false;
};
-#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
+#if TEST_STD_VER >= 26
return arg.visit(std::move(visitor));
#else
return std::visit_format_arg(std::move(visitor), arg);
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 2fc25fc024ac1..ff1d0e4d8ff1d 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -525,13 +525,6 @@ inline Tp const& DoNotOptimize(Tp const& value) {
# define TEST_IF_AIX(arg_true, arg_false) arg_false
#endif
-// Clang-18 has support for deducing this, but it does not set the FTM.
-#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
-// This is a C++20 featue, so we don't care whether the compiler could support it
-#elif defined(_LIBCPP_VERSION) && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
-# define TEST_HAS_EXPLICIT_THIS_PARAMETER
-#endif
-
// Placement `operator new`/`operator new[]` are not yet constexpr in C++26
// when using MS ABI, because they are from <vcruntime_new.h>.
#if defined(__cpp_lib_constexpr_new) && __cpp_lib_constexpr_new >= 202406L
More information about the libcxx-commits
mailing list