diff --git a/Makefile b/Makefile index b74d79be1..169f641a9 100644 --- a/Makefile +++ b/Makefile @@ -539,7 +539,7 @@ endif ifdef USE_CLANG # Used by some teams in Facebook - WARNING_FLAGS += -Wshift-sign-overflow + WARNING_FLAGS += -Wshift-sign-overflow -Wambiguous-reversed-operator endif ifeq ($(PLATFORM), OS_OPENBSD) diff --git a/util/ribbon_test.cc b/util/ribbon_test.cc index 6519df3d5..cd1c437c3 100644 --- a/util/ribbon_test.cc +++ b/util/ribbon_test.cc @@ -104,11 +104,11 @@ struct StandardKeyGen { return str_; } - bool operator==(const StandardKeyGen& other) { + bool operator==(const StandardKeyGen& other) const { // Same prefix is assumed return id_ == other.id_; } - bool operator!=(const StandardKeyGen& other) { + bool operator!=(const StandardKeyGen& other) const { // Same prefix is assumed return id_ != other.id_; } @@ -144,8 +144,8 @@ struct SmallKeyGen { return str_; } - bool operator==(const SmallKeyGen& other) { return id_ == other.id_; } - bool operator!=(const SmallKeyGen& other) { return id_ != other.id_; } + bool operator==(const SmallKeyGen& other) const { return id_ == other.id_; } + bool operator!=(const SmallKeyGen& other) const { return id_ != other.id_; } uint64_t id_; std::string str_; @@ -1069,11 +1069,11 @@ struct PhsfInputGen { const std::pair* operator->() { return &**this; } - bool operator==(const PhsfInputGen& other) { + bool operator==(const PhsfInputGen& other) const { // Same prefix is assumed return id_ == other.id_; } - bool operator!=(const PhsfInputGen& other) { + bool operator!=(const PhsfInputGen& other) const { // Same prefix is assumed return id_ != other.id_; }