[LLVMbugs] [Bug 14842] New: Warn when -isEqual: is overridden without corresponding -hash override

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 7 19:25:44 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=14842

             Bug #: 14842
           Summary: Warn when -isEqual: is overridden without
                    corresponding -hash override
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: edog1203 at mac.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Overriding -isEqual: to provide custom equality checking without a
corresponding -hash override to ensure that equal objects always have the same
hash can result in subtle bugs involving NSSet and NSDictionary membership. For
more details, see
http://www.mikeash.com/pyblog/friday-qa-2012-12-14-objective-c-pitfalls.html

It would be handy if the Clang static analyzer warned in such cases.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list