Skip to content

Commit 819cac6

Browse files
mordantetstellar
authored andcommitted
[libc++] Fixes (|multi)_set spaceship operator. (llvm#127326)
The operators did not have a _Compare template arguement. The fix updates the generic container test to use allocators for all types used. No other issues were found. Fixes: llvm#127095 (cherry picked from commit 248716f)
1 parent 99eab31 commit 819cac6

File tree

2 files changed

+168
-106
lines changed

2 files changed

+168
-106
lines changed

libcxx/include/set

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,9 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare,
10031003

10041004
# else // _LIBCPP_STD_VER <= 17
10051005

1006-
template <class _Key, class _Allocator>
1006+
template <class _Key, class _Compare, class _Allocator>
10071007
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>
1008-
operator<=>(const set<_Key, _Allocator>& __x, const set<_Key, _Allocator>& __y) {
1008+
operator<=>(const set<_Key, _Compare, _Allocator>& __x, const set<_Key, _Compare, _Allocator>& __y) {
10091009
return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
10101010
}
10111011

@@ -1470,9 +1470,9 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key,
14701470

14711471
# else // _LIBCPP_STD_VER <= 17
14721472

1473-
template <class _Key, class _Allocator>
1473+
template <class _Key, class _Compare, class _Allocator>
14741474
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>
1475-
operator<=>(const multiset<_Key, _Allocator>& __x, const multiset<_Key, _Allocator>& __y) {
1475+
operator<=>(const multiset<_Key, _Compare, _Allocator>& __x, const multiset<_Key, _Compare, _Allocator>& __y) {
14761476
return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way);
14771477
}
14781478

0 commit comments

Comments
 (0)