null pointer warning

Hi All,

I'm trying to implement a warning for PR7569, patch attached:

null-pointer-warning.patch (3.24 KB)

CheckImplicitConversions triggers on a full-expression and walks the entire expression tree, but it does so for much better reasons. I think what you really want to do is to hook the lvalue-to-rvalue conversion; I'm not sure if there's a single point where that happens, though.

Presumably you also want to not warn on
  int &ref = *(int*) 0;


After discussion, it turns out that this is a lot harder than it should be. Instead of handling the general case, I just ended up doing a syntactic check in r107756. The static analyzer already handles the more complex cases in a far more general way, let it do its job :slight_smile:

Thanks John,