Skip to content

Commit 0598b29

Browse files
ahatanakahmedbougacha
authored andcommitted
Declare operator== as a friend function instead of a member function
1 parent 6d578df commit 0598b29

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

clang/lib/CodeGen/CGPointerAuthInfo.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,15 @@ class CGPointerAuthInfo {
8181
return AuthenticationMode == PointerAuthenticationMode::SignAndAuth;
8282
}
8383

84-
bool operator!=(const CGPointerAuthInfo &Other) const {
85-
return Key != Other.Key || Discriminator != Other.Discriminator ||
86-
AuthenticationMode != Other.AuthenticationMode;
84+
friend bool operator!=(const CGPointerAuthInfo &LHS,
85+
const CGPointerAuthInfo &RHS) {
86+
return LHS.Key != RHS.Key || LHS.Discriminator != RHS.Discriminator ||
87+
LHS.AuthenticationMode != RHS.AuthenticationMode;
8788
}
8889

89-
bool operator==(const CGPointerAuthInfo &Other) const {
90-
return !(*this != Other);
90+
friend bool operator==(const CGPointerAuthInfo &LHS,
91+
const CGPointerAuthInfo &RHS) {
92+
return !(LHS != RHS);
9193
}
9294
};
9395

0 commit comments

Comments
 (0)