[PATCH] D78938: Fixing all comparisons for C++20 compilation.

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 10:43:30 PDT 2020


Quuxplusone added inline comments.


================
Comment at: llvm/include/llvm/Support/BinaryStreamRef.h:124
 
-  bool operator==(const RefType &Other) const {
-    if (BorrowedImpl != Other.BorrowedImpl)
+  friend bool operator==(const RefType &Self, const RefType &Other) {
+    if (Self.BorrowedImpl != Other.BorrowedImpl)
----------------
Is there a neat rule of thumb for when you were able to preserve the member `bool Me::operator==(const Me& rhs) const` versus when you were forced to change it to a hidden friend? It seems like maybe you changed it to a hidden friend only in cases where `Me` was a base class, is that right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78938





More information about the cfe-commits mailing list