1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:57:42 +00:00

AK/Complex: C++20-compatible comparison operators

Problem:
- Clang correctly reports non-`const` member function comparison
  operators as ambiguous.

Solution:
- Make them `const`.
This commit is contained in:
Lenny Maiorani 2021-04-18 10:52:11 -06:00 committed by Andreas Kling
parent 97f4aa166a
commit 0ac02b9084
2 changed files with 9 additions and 2 deletions

View file

@ -119,7 +119,14 @@ TEST_CASE(assign_moved_self)
{
RefPtr<Object> 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);
}