Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,7 @@ 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)
# if defined(__OBJC__) && defined(_LIBCPP_APPLE_CLANG_VER)
# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS
# endif

Expand Down Expand Up @@ -1255,14 +1254,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
8 changes: 0 additions & 8 deletions libcxx/include/__configuration/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,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
Expand Down
17 changes: 7 additions & 10 deletions libcxx/include/__format/format_arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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.
///
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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: {
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__format/format_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}) {
}

Expand Down
12 changes: 0 additions & 12 deletions libcxx/include/__hash_table
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,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 {
Expand Down
15 changes: 6 additions & 9 deletions libcxx/include/__iterator/concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 (https://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>
Expand Down
15 changes: 4 additions & 11 deletions libcxx/include/__math/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions libcxx/include/__ranges/transform_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <__compare/three_way_comparable.h>
#include <__concepts/constructible.h>
#include <__concepts/convertible_to.h>
#include <__concepts/copyable.h>
#include <__concepts/derived_from.h>
#include <__concepts/equality_comparable.h>
#include <__concepts/invocable.h>
Expand Down Expand Up @@ -64,7 +63,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>
Expand Down
12 changes: 0 additions & 12 deletions libcxx/include/__tree
Original file line number Diff line number Diff line change
Expand Up @@ -823,18 +823,6 @@ public:
using __node_allocator _LIBCPP_NODEBUG = __rebind_alloc<__alloc_traits, __node>;
using __node_traits _LIBCPP_NODEBUG = allocator_traits<__node_allocator>;

// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 0 additions & 11 deletions libcxx/include/forward_list
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,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>
Expand Down
11 changes: 0 additions & 11 deletions libcxx/include/list
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,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>
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,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>)
Expand All @@ -328,7 +328,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 {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/variant
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
//

// __is_referenceable_v<Tp>
// __libcpp_is_referenceable<Tp>
//
// [defns.referenceable] defines "a referenceable type" as:
// An object type, a function type that does not have cv-qualifiers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading
Loading