<html>
    <head>
      <base href="http://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 --- - Xcode 4.6 static analyzer false positive calling non-virtual C++ methods on NULL pointers where method implementation provides NULL check"
   href="http://llvm.org/bugs/show_bug.cgi?id=15870">15870</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Xcode 4.6 static analyzer false positive calling non-virtual C++ methods on NULL pointers where method implementation provides NULL check
          </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>rob@ragfield.name
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Run the following code through the Xcode 4.6.2 static analyzer:


#include <iostream>
#include <math.h>

class FooBar
{
public:
    void method() { std::cout << "this is " << (this ? "NOT NULL" : "NULL") <<
"\n"; }
};

int main(int argc, const char * argv[])
{
    FooBar* foo = NULL;
    foo->method();
    return 0;
}


It produces the following issue:

FooBar/main.cpp:21:2: Called C++ object pointer is null

even though the code works fine.  My large project has this issue flagged
hundreds of times, making the static analyzer not as useful to me as it used to
be.</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>