diff options
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/objc-missing-hash.rst')
| -rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/objc-missing-hash.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/objc-missing-hash.rst b/clang-tools-extra/docs/clang-tidy/checks/objc-missing-hash.rst new file mode 100644 index 00000000000..ea8f775897c --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/objc-missing-hash.rst @@ -0,0 +1,16 @@ +.. title:: clang-tidy - objc-missing-hash + +objc-missing-hash +================= + +Finds Objective-C implementations that implement ``-isEqual:`` without also +appropriately implementing ``-hash``. + +Apple documentation highlights that objects that are equal must have the same +hash value: +https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418795-isequal?language=objc + +Note that the check only verifies the presence of ``-hash`` in scenarios where +its omission could result in unexpected behavior. The verification of the +implementation of ``-hash`` is the responsibility of the developer, e.g., +through the addition of unit tests to verify the implementation. |

