This revision was automatically updated to reflect the committed changes.
Closed by commit rG971bd6f83440: Fix build failure with MSVC in C++20 mode 
(authored by Godin, committed by sammccall).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116904

Files:
  clang/include/clang/Tooling/Syntax/Tree.h


Index: clang/include/clang/Tooling/Syntax/Tree.h
===================================================================
--- clang/include/clang/Tooling/Syntax/Tree.h
+++ clang/include/clang/Tooling/Syntax/Tree.h
@@ -181,7 +181,10 @@
     ChildIteratorBase() = default;
     explicit ChildIteratorBase(NodeT *N) : N(N) {}
 
-    bool operator==(const DerivedT &O) const { return O.N == N; }
+    friend bool operator==(const DerivedT &LHS, const DerivedT &RHS) {
+      return LHS.N == RHS.N;
+    }
+
     NodeT &operator*() const { return *N; }
     DerivedT &operator++() {
       N = N->getNextSibling();
@@ -269,14 +272,6 @@
   Node *LastChild = nullptr;
 };
 
-// Provide missing non_const == const overload.
-// iterator_facade_base requires == to be a member, but implicit conversions
-// don't work on the LHS of a member operator.
-inline bool operator==(const Tree::ConstChildIterator &A,
-                       const Tree::ConstChildIterator &B) {
-  return A.operator==(B);
-}
-
 /// A list of Elements separated or terminated by a fixed token.
 ///
 /// This type models the following grammar construct:


Index: clang/include/clang/Tooling/Syntax/Tree.h
===================================================================
--- clang/include/clang/Tooling/Syntax/Tree.h
+++ clang/include/clang/Tooling/Syntax/Tree.h
@@ -181,7 +181,10 @@
     ChildIteratorBase() = default;
     explicit ChildIteratorBase(NodeT *N) : N(N) {}
 
-    bool operator==(const DerivedT &O) const { return O.N == N; }
+    friend bool operator==(const DerivedT &LHS, const DerivedT &RHS) {
+      return LHS.N == RHS.N;
+    }
+
     NodeT &operator*() const { return *N; }
     DerivedT &operator++() {
       N = N->getNextSibling();
@@ -269,14 +272,6 @@
   Node *LastChild = nullptr;
 };
 
-// Provide missing non_const == const overload.
-// iterator_facade_base requires == to be a member, but implicit conversions
-// don't work on the LHS of a member operator.
-inline bool operator==(const Tree::ConstChildIterator &A,
-                       const Tree::ConstChildIterator &B) {
-  return A.operator==(B);
-}
-
 /// A list of Elements separated or terminated by a fixed token.
 ///
 /// This type models the following grammar construct:
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to