[cfe-commits] [PATCH][Review request]Support for c++0x nullptr in static analyzer

Ted Kremenek kremenek at apple.com
Wed Apr 20 17:22:52 PDT 2011


On Apr 20, 2011, at 4:15 PM, Douglas Gregor wrote:

> 
> On Apr 20, 2011, at 3:52 PM, Jim Goodnow II wrote:
> 
>> Hi Ted,
>> 
>> Yes, we do. The real purpose of the nullptr is the last part of the test 
>> program where it allows you to distinguish between two overloaded 
>> functions, i.e.:
>> 
>> void func( int );
>> void func( int *);
>> 
>> If you call it with the standard NULL, it will call the "int" version, 
>> whereas if you call it with nullptr, it will call the "int *" version. 
> 
> That shouldn't matter to the static analyzer, since Sema has already performed overload resolution long before the static analyzer ever sees the AST.

Right.  This is already done by Sema.  The SVal just represents the "semantics" of the value, not how it is involved in any work done by type-checking, method resolution, etc.



More information about the cfe-commits mailing list