diff --git a/AK/Complex.h b/AK/Complex.h index 832ead8b96..6fe71d2efe 100644 --- a/AK/Complex.h +++ b/AK/Complex.h @@ -243,13 +243,13 @@ public: } template - constexpr bool operator==(const Complex& a) + constexpr bool operator==(const Complex& a) const { return (this->real() == a.real()) && (this->imag() == a.imag()); } template - constexpr bool operator!=(const Complex& a) + constexpr bool operator!=(const Complex& a) const { return !(*this == a); } diff --git a/AK/Tests/TestRefPtr.cpp b/AK/Tests/TestRefPtr.cpp index f823944b44..fed2022af6 100644 --- a/AK/Tests/TestRefPtr.cpp +++ b/AK/Tests/TestRefPtr.cpp @@ -119,7 +119,14 @@ TEST_CASE(assign_moved_self) { RefPtr object = adopt(*new Object); EXPECT_EQ(object->ref_count(), 1u); +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wself-move" +#endif object = move(object); +#ifdef __clang__ +# pragma clang diagnostic pop +#endif EXPECT_EQ(object->ref_count(), 1u); }