aaron.ballman added a comment. I'm definitely worried about the false positive rate for this check -- from a quick look at the diagnostics from LLVM, every one of them is a false positive (though perhaps I've missed something; it was a very quick look). Requiring users to explicitly use a declaration within the operator seems like it could get onerous for complex classes that support the notion of equality from a few members as opposed to all members.
Also, can you add some tests for classes that inherit members, perhaps even private ones? e.g., struct Base { int Member; }; struct Derived : Base { int OtherMember; bool operator==(const Derived &RHS) const { return OtherMember == RHS.OtherMember; } }; struct Derived2 : private Base { int OtherMember; bool operator==(const Derived2 &RHS) const { return OtherMember == RHS.OtherMember; } }; Another good test is for scenarios where you cannot compare all of the members, such as: struct Interesting { bool operator==(const Interesting &Other) const = delete; }; struct S { int Member; Interesting OtherMember; bool operator==(const S &Other) const { return Member == Other.Member; } }; Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59103/new/ https://reviews.llvm.org/D59103 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits