[libcxx-commits] [PATCH] D130853: [libc++] Remove `operator!=` from `type_info` in C++20

Adrian Vogelsgesang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 3 15:43:54 PDT 2022


avogelsgesang updated this revision to Diff 449810.
avogelsgesang marked an inline comment as done.
avogelsgesang added a comment.

add to status page & remove both `operator!=` implementations


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130853/new/

https://reviews.llvm.org/D130853

Files:
  libcxx/docs/Status/SpaceshipProjects.csv
  libcxx/include/typeinfo


Index: libcxx/include/typeinfo
===================================================================
--- libcxx/include/typeinfo
+++ libcxx/include/typeinfo
@@ -22,7 +22,7 @@
     virtual ~type_info();
 
     bool operator==(const type_info& rhs) const noexcept;
-    bool operator!=(const type_info& rhs) const noexcept;
+    bool operator!=(const type_info& rhs) const noexcept; // removed in C++20
 
     bool before(const type_info& rhs) const noexcept;
     size_t hash_code() const noexcept;
@@ -112,9 +112,11 @@
       return __compare(__arg) == 0;
     }
 
+#if _LIBCPP_STD_VER <= 17
     _LIBCPP_INLINE_VISIBILITY
     bool operator!=(const type_info& __arg) const _NOEXCEPT
     { return !operator==(__arg); }
+#endif
 };
 
 #else // !defined(_LIBCPP_ABI_MICROSOFT)
@@ -337,9 +339,11 @@
       return __impl::__eq(__type_name, __arg.__type_name);
     }
 
+#if _LIBCPP_STD_VER <= 17
     _LIBCPP_INLINE_VISIBILITY
     bool operator!=(const type_info& __arg) const _NOEXCEPT
     { return !operator==(__arg); }
+#endif
 };
 #endif // defined(_LIBCPP_ABI_MICROSOFT)
 
Index: libcxx/docs/Status/SpaceshipProjects.csv
===================================================================
--- libcxx/docs/Status/SpaceshipProjects.csv
+++ libcxx/docs/Status/SpaceshipProjects.csv
@@ -12,6 +12,7 @@
 | `weak_order_fallback <https://reviews.llvm.org/D111514>`_
 | `partial_order_fallback <https://reviews.llvm.org/D111514>`_",None,Arthur O'Dwyer,|Complete| [#note-strongorder]_
 | `[alg.three.way] <https://wg21.link/alg.three.way>`_,| `lexicographical_compare_three_way <https://reviews.llvm.org/D80902>`_,[comparisons.three.way],Christopher Di Bella,|In Progress|
+| `[type.info] <https://wg21.link/type.info>`_,| `typeinfo <https://reviews.llvm.org/D130853#inline-1261074>`_,None,Adrian Vogelsgesang,|Complete|
 | `[coroutine.handle.compare] <https://wg21.link/coroutine.handle.compare>`_,| `coroutine_handle <https://reviews.llvm.org/D109433>`_,[comparisons.three.way],Chuanqi Xu,|Complete|
 | `[pairs.spec] <https://wg21.link/pairs.spec>`_,| `pair <https://reviews.llvm.org/D107721>`_,[expos.only.func],Kent Ross,|Complete|
 | `[syserr.errcat.nonvirtuals] <https://wg21.link/syserr.errcat.nonvirtuals>`_,| error_category,[comparisons.three.way],Unassigned,|Not Started|


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130853.449810.patch
Type: text/x-patch
Size: 2274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220803/640cb5f7/attachment-0001.bin>


More information about the libcxx-commits mailing list