<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - osx.cocoa.NSError checker false positive on overridden method"
   href="https://llvm.org/bugs/show_bug.cgi?id=25555">25555</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>osx.cocoa.NSError checker false positive on overridden method
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>levigroker@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=15300" name="attach_15300" title="Sample project demonstrating the issue.">attachment 15300</a> <a href="attachment.cgi?id=15300&action=edit" title="Sample project demonstrating the issue.">[details]</a></span>
Sample project demonstrating the issue.

The `osx.cocoa.NSError` checker reports an analysis warning on the child
implementation of an overridden method which would not pass the checker.

For instance, `NSFileCoordinator` declares `-
(void)coordinateReadingItemAtURL:(NSURL *)url
options:(NSFileCoordinatorReadingOptions)options error:(NSError **)outError
byAccessor:(void (^)(NSURL *))reader` which fails this checker (reports "Method
accepting NSError** should have a non-void return value to indicate whether or
not an error occurred"). A subclass of `NSFileCoordinator` which overrides this
method has no choice but to use the same method signature, and therefore will
fail the checker.

While it may be debatable this is to be considered a false positive, a couple
possible solutions come to mind:

1. Have the checker understand this is an overridden method and present the
warning on the parent class.
2. Provide a way to suppress this specific checker only for this and similar
overrides (perhaps via a #pragma push/pop mechanism).

Please see the attached Xcode 7.1.1 project, which exhibits this issue when
Xcode Analyze is performed.

Thank you,

Levi</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>