From: Hristo Hristov Date: Sat, 10 Jun 2023 07:52:09 +0000 (+0300) Subject: [libc++][spaceship] P1614R2: Removed global `operator!=` from `allocator` X-Git-Tag: upstream/17.0.6~5442 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1ef99fe1ce3e2996c317600a1398933b9078260;p=platform%2Fupstream%2Fllvm.git [libc++][spaceship] P1614R2: Removed global `operator!=` from `allocator` Implements parts of P1614R2: - Removed global `operator!=` from `allocator` Reviewed By: #libc, Mordante Differential Revision: https://reviews.llvm.org/D152612 --- diff --git a/libcxx/docs/Status/SpaceshipProjects.csv b/libcxx/docs/Status/SpaceshipProjects.csv index b8eaa76..f075776 100644 --- a/libcxx/docs/Status/SpaceshipProjects.csv +++ b/libcxx/docs/Status/SpaceshipProjects.csv @@ -52,7 +52,7 @@ Section,Description,Dependencies,Assignee,Complete "| `[template.bitset] `_ | `[bitset.members] `_","| remove ops `bitset `_",None,Hristo Hristov,|Complete| | `[memory.syn] `_,|,None,Unassigned,|Not Started| -| `[allocator.globals] `_,| remove ops `allocator `_,None,Hristo Hristov,|In Progress| +| `[allocator.globals] `_,| remove ops `allocator `_,None,Hristo Hristov,|Complete| | `[unique.ptr.special] `_,| `unique_ptr `_,[comparisons.three.way],Adrian Vogelsgesang,|Complete| | `[util.smartptr.shared.cmp] `_,| `shared_ptr `_,[comparisons.three.way],Adrian Vogelsgesang,|Complete| "| `[mem.res.syn] `_ diff --git a/libcxx/include/__memory/allocator.h b/libcxx/include/__memory/allocator.h index badfea0..47e1ef9 100644 --- a/libcxx/include/__memory/allocator.h +++ b/libcxx/include/__memory/allocator.h @@ -262,10 +262,14 @@ template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;} +#if _LIBCPP_STD_VER <= 17 + template -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 +inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;} +#endif + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___MEMORY_ALLOCATOR_H diff --git a/libcxx/include/memory b/libcxx/include/memory index 3946884..cd6bcc7 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -160,7 +160,7 @@ template bool operator==(const allocator&, const allocator&) noexcept; // constexpr in C++20 template -bool operator!=(const allocator&, const allocator&) noexcept; // constexpr in C++20 +bool operator!=(const allocator&, const allocator&) noexcept; // removed in C++20 template class raw_storage_iterator // deprecated in C++17, removed in C++20