Skip to content

Commit b9094b8

Browse files
committed
Avoids GCC CI issue.
1 parent 865690c commit b9094b8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

libcxx/include/__chrono/leap_second.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class leap_second {
5555
_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const leap_second& __x, const leap_second& __y) {
5656
return __x.date() == __y.date();
5757
}
58+
5859
_LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(const leap_second& __x, const leap_second& __y) {
5960
return __x.date() <=> __y.date();
6061
}
@@ -63,43 +64,56 @@ template <class _Duration>
6364
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const leap_second& __x, const sys_time<_Duration>& __y) {
6465
return __x.date() == __y;
6566
}
67+
6668
template <class _Duration>
6769
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const leap_second& __x, const sys_time<_Duration>& __y) {
6870
return __x.date() < __y;
6971
}
72+
7073
template <class _Duration>
7174
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const sys_time<_Duration>& __x, const leap_second& __y) {
7275
return __x < __y.date();
7376
}
77+
7478
template <class _Duration>
7579
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const leap_second& __x, const sys_time<_Duration>& __y) {
7680
return __y < __x;
7781
}
82+
7883
template <class _Duration>
7984
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const sys_time<_Duration>& __x, const leap_second& __y) {
8085
return __y < __x;
8186
}
87+
8288
template <class _Duration>
8389
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const leap_second& __x, const sys_time<_Duration>& __y) {
8490
return !(__y < __x);
8591
}
92+
8693
template <class _Duration>
8794
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const sys_time<_Duration>& __x, const leap_second& __y) {
8895
return !(__y < __x);
8996
}
97+
9098
template <class _Duration>
9199
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const leap_second& __x, const sys_time<_Duration>& __y) {
92100
return !(__x < __y);
93101
}
102+
94103
template <class _Duration>
95104
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const sys_time<_Duration>& __x, const leap_second& __y) {
96105
return !(__x < __y);
97106
}
107+
108+
# ifndef _LIBCPP_COMPILER_GCC
109+
// This requirement cauese a compilation loop in GCC-13 and running out of memory.
110+
// TODO TZDB Test whether GCC-14 fixes this.
98111
template <class _Duration>
99112
requires three_way_comparable_with<sys_seconds, sys_time<_Duration>>
100113
_LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(const leap_second& __x, const sys_time<_Duration>& __y) {
101114
return __x.date() <=> __y;
102115
}
116+
# endif
103117

104118
} // namespace chrono
105119

libcxx/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: c++03, c++11, c++14, c++17
1010
// UNSUPPORTED: no-filesystem, no-localization, no-tzdb
1111

12+
// TODO TZDB test whether this can be enabled with gcc 14.
13+
// UNSUPPORTED: gcc
14+
1215
// XFAIL: libcpp-has-no-incomplete-tzdb
1316
// XFAIL: availability-tzdb-missing
1417

0 commit comments

Comments
 (0)