Skip to content

Commit 6d2b767

Browse files
authored
[NFC][libc++] Removes Clang 16 work-arounds. (#91636)
This was noticed while reviewing the implementation status of P1614R2 The Mothership has Landed Drive-by: Add some missing _LIBCPP_HIDE_FROM_ABIs.
1 parent 231aa30 commit 6d2b767

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

libcxx/include/queue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,12 @@ public:
428428
template <class _T1, class _OtherContainer>
429429
friend _LIBCPP_HIDE_FROM_ABI bool
430430
operator<(const queue<_T1, _OtherContainer>& __x, const queue<_T1, _OtherContainer>& __y);
431+
432+
# if _LIBCPP_STD_VER >= 20
433+
template <class _T1, three_way_comparable _OtherContainer>
434+
friend _LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_OtherContainer>
435+
operator<=>(const queue<_T1, _OtherContainer>& __x, const queue<_T1, _OtherContainer>& __y);
436+
# endif
431437
};
432438

433439
# if _LIBCPP_STD_VER >= 17
@@ -497,8 +503,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const queue<_Tp, _Container>& __x,
497503
template <class _Tp, three_way_comparable _Container>
498504
_LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_Container>
499505
operator<=>(const queue<_Tp, _Container>& __x, const queue<_Tp, _Container>& __y) {
500-
// clang 16 bug: declaring `friend operator<=>` causes "use of overloaded operator '*' is ambiguous" errors
501-
return __x.__get_container() <=> __y.__get_container();
506+
return __x.c <=> __y.c;
502507
}
503508

504509
# endif

libcxx/include/stack

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,18 @@ public:
279279
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Container& __get_container() const { return c; }
280280

281281
template <class _T1, class _OtherContainer>
282-
friend bool operator==(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
282+
friend _LIBCPP_HIDE_FROM_ABI bool
283+
operator==(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
283284

284285
template <class _T1, class _OtherContainer>
285-
friend bool operator<(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
286+
friend _LIBCPP_HIDE_FROM_ABI bool
287+
operator<(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
288+
289+
# if _LIBCPP_STD_VER >= 20
290+
template <class _T1, three_way_comparable _OtherContainer>
291+
friend _LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_OtherContainer>
292+
operator<=>(const stack<_T1, _OtherContainer>& __x, const stack<_T1, _OtherContainer>& __y);
293+
# endif
286294
};
287295

288296
# if _LIBCPP_STD_VER >= 17
@@ -353,8 +361,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const stack<_Tp, _Container>& __x,
353361
template <class _Tp, three_way_comparable _Container>
354362
_LIBCPP_HIDE_FROM_ABI compare_three_way_result_t<_Container>
355363
operator<=>(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) {
356-
// clang 16 bug: declaring `friend operator<=>` causes "use of overloaded operator '*' is ambiguous" errors
357-
return __x.__get_container() <=> __y.__get_container();
364+
return __x.c <=> __y.c;
358365
}
359366

360367
# endif

0 commit comments

Comments
 (0)