r179736 - [analyzer] Tweak getDerefExpr more to track DeclRefExprs to references.

Jordan Rose jordan_rose at apple.com
Wed Apr 17 18:14:09 PDT 2013


On Apr 17, 2013, at 17:15 , Anna Zaks <ganna at apple.com> wrote:

> +  // This is not valid C++; dynamic_cast with a reference type will throw an
> +  // exception if the pointer does not match the expected type. However, our
> +  // implementation of dynamic_cast will pass through a null pointer...or a
> +  // "null reference"! So this branch is actually possible.
> +  if (&val == 0) { //expected-note {{Assuming pointer value is null}}

I know this is just a test, but the comment is bogus. Instead it's something like this:

// This is not valid C++; if 'ptr' were null, creating 'ref' would be illegal.
// However, this is not checked at runtime, so this branch is actually possible.

Not sure if that's 80 cols or more.
Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130417/f6aef737/attachment.html>


More information about the cfe-commits mailing list