Skip to content

Commit 85ca551

Browse files
[libc++][chrono] Entirely remove relational operators for std::chrono::weekday (llvm#122428)
Follows-up llvm#98730.
1 parent f44ed64 commit 85ca551

File tree

3 files changed

+2
-41
lines changed

3 files changed

+2
-41
lines changed

libcxx/docs/ReleaseNotes/20.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ Deprecations and Removals
117117
removed in language modes prior to C++20. If you are using these features prior to C++20, you will need to
118118
update to ``-std=c++20``.
119119

120-
- TODO: The relational operators for ``std::chrono::weekday`` will be removed entirely, and the
121-
``_LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS`` macro that was used to re-enable this extension will be
122-
ignored in LLVM 20.
120+
- The relational operators for ``std::chrono::weekday`` has been removed entirely, and the
121+
``_LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS`` macro is now ignored.
123122

124123
- The ``_LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST`` macro no longer has any effect. ``std::allocator<const T>`` is not
125124
supported as an extension anymore, please migrate any code that uses e.g. ``std::vector<const T>`` to be

libcxx/include/__chrono/weekday.h

-19
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,6 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const weekday& __lhs, con
7979
return __lhs.c_encoding() == __rhs.c_encoding();
8080
}
8181

82-
// TODO(LLVM 20): Remove the escape hatch
83-
# ifdef _LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS
84-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(const weekday& __lhs, const weekday& __rhs) noexcept {
85-
return __lhs.c_encoding() < __rhs.c_encoding();
86-
}
87-
88-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(const weekday& __lhs, const weekday& __rhs) noexcept {
89-
return __rhs < __lhs;
90-
}
91-
92-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(const weekday& __lhs, const weekday& __rhs) noexcept {
93-
return !(__rhs < __lhs);
94-
}
95-
96-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(const weekday& __lhs, const weekday& __rhs) noexcept {
97-
return !(__lhs < __rhs);
98-
}
99-
# endif // _LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS
100-
10182
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator+(const weekday& __lhs, const days& __rhs) noexcept {
10283
auto const __mu = static_cast<long long>(__lhs.c_encoding()) + __rhs.count();
10384
auto const __yr = (__mu >= 0 ? __mu : __mu - 6) / 7;

libcxx/include/__cxx03/__chrono/weekday.h

-19
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,6 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const weekday& __lhs, con
7979
return __lhs.c_encoding() == __rhs.c_encoding();
8080
}
8181

82-
// TODO(LLVM 20): Remove the escape hatch
83-
# ifdef _LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS
84-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(const weekday& __lhs, const weekday& __rhs) noexcept {
85-
return __lhs.c_encoding() < __rhs.c_encoding();
86-
}
87-
88-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(const weekday& __lhs, const weekday& __rhs) noexcept {
89-
return __rhs < __lhs;
90-
}
91-
92-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(const weekday& __lhs, const weekday& __rhs) noexcept {
93-
return !(__rhs < __lhs);
94-
}
95-
96-
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(const weekday& __lhs, const weekday& __rhs) noexcept {
97-
return !(__lhs < __rhs);
98-
}
99-
# endif // _LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS
100-
10182
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator+(const weekday& __lhs, const days& __rhs) noexcept {
10283
auto const __mu = static_cast<long long>(__lhs.c_encoding()) + __rhs.count();
10384
auto const __yr = (__mu >= 0 ? __mu : __mu - 6) / 7;

0 commit comments

Comments
 (0)