[cfe-dev] null pointer warning

John McCall rjmccall at apple.com
Mon Jul 5 13:35:30 PDT 2010


On Jul 5, 2010, at 12:20 PM, Chris Lattner wrote:
> Is there a better place to slot this into Sema?  I didn't follow the warning work John did, but it seems like it must have had to solve similar problems.

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;
?

John.



More information about the cfe-dev mailing list