[libcxx-commits] [PATCH] D114570: [libc++] Avoid overload resolution in path comparison operators

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 25 08:41:43 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG3e7452a812fa: [libc++] Avoid overload resolution in path comparison operators (authored by joe_loser).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114570

Files:
  libcxx/include/filesystem


Index: libcxx/include/filesystem
===================================================================
--- libcxx/include/filesystem
+++ libcxx/include/filesystem
@@ -1492,22 +1492,22 @@
 #endif // !_LIBCPP_HAS_NO_LOCALIZATION
 
   friend _LIBCPP_INLINE_VISIBILITY bool operator==(const path& __lhs, const path& __rhs) noexcept {
-    return __lhs.compare(__rhs) == 0;
+    return __lhs.__compare(__rhs.__pn_) == 0;
   }
   friend _LIBCPP_INLINE_VISIBILITY bool operator!=(const path& __lhs, const path& __rhs) noexcept {
-    return __lhs.compare(__rhs) != 0;
+    return __lhs.__compare(__rhs.__pn_) != 0;
   }
   friend _LIBCPP_INLINE_VISIBILITY bool operator<(const path& __lhs, const path& __rhs) noexcept {
-    return __lhs.compare(__rhs) < 0;
+    return __lhs.__compare(__rhs.__pn_) < 0;
   }
   friend _LIBCPP_INLINE_VISIBILITY bool operator<=(const path& __lhs, const path& __rhs) noexcept {
-    return __lhs.compare(__rhs) <= 0;
+    return __lhs.__compare(__rhs.__pn_) <= 0;
   }
   friend _LIBCPP_INLINE_VISIBILITY bool operator>(const path& __lhs, const path& __rhs) noexcept {
-    return __lhs.compare(__rhs) > 0;
+    return __lhs.__compare(__rhs.__pn_) > 0;
   }
   friend _LIBCPP_INLINE_VISIBILITY bool operator>=(const path& __lhs, const path& __rhs) noexcept {
-    return __lhs.compare(__rhs) >= 0;
+    return __lhs.__compare(__rhs.__pn_) >= 0;
   }
 
   friend _LIBCPP_INLINE_VISIBILITY path operator/(const path& __lhs,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114570.389816.patch
Type: text/x-patch
Size: 1445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211125/388b159a/attachment.bin>


More information about the libcxx-commits mailing list