[libc++] [P0619] Add _LIBCPP_ABI_NO_BINDER_BASES and remove binder typedefs in C++20.

Differential Revision: https://reviews.llvm.org/D103753

NOKEYCHECK=True
GitOrigin-RevId: dc066888bd98c0500ca7b590317dc91ccce0fd38
diff --git a/include/optional b/include/optional
index 8a291a6..0e6c1b8 100644
--- a/include/optional
+++ b/include/optional
@@ -1407,11 +1407,13 @@
     __enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>>
 >
 {
-    typedef optional<_Tp> argument_type;
-    typedef size_t        result_type;
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    _LIBCPP_DEPRECATED_IN_CXX17 typedef optional<_Tp> argument_type;
+    _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t        result_type;
+#endif
 
     _LIBCPP_INLINE_VISIBILITY
-    result_type operator()(const argument_type& __opt) const
+    size_t operator()(const optional<_Tp>& __opt) const
     {
         return static_cast<bool>(__opt) ? hash<remove_const_t<_Tp>>()(*__opt) : 0;
     }