diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.h b/compiler-rt/lib/sanitizer_common/sanitizer_mac.h index f0a97d098eea0..4de0605e18f03 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.h @@ -37,9 +37,6 @@ struct VersionBase { VersionBase(u16 major, u16 minor) : major(major), minor(minor) {} - bool operator==(const VersionType &other) const { - return major == other.major && minor == other.minor; - } bool operator>=(const VersionType &other) const { return major > other.major || (major == other.major && minor >= other.minor); @@ -47,6 +44,11 @@ struct VersionBase { bool operator<(const VersionType &other) const { return !(*this >= other); } }; +template +bool operator==(const VersionType &self, const VersionType &other) { + return self.major == other.major && self.minor == other.minor; +} + struct MacosVersion : VersionBase { MacosVersion(u16 major, u16 minor) : VersionBase(major, minor) {} };