[cfe-commits] r154434 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/Store.h lib/StaticAnalyzer/Core/ExprEngineC.cpp lib/StaticAnalyzer/Core/RegionStore.cpp test/Analysis/dynamic-cast.cpp

Richard Smith richard at metafoo.co.uk
Tue Apr 10 20:51:53 PDT 2012


On Tue, Apr 10, 2012 at 1:59 PM, Anna Zaks <ganna at apple.com> wrote:

> Added: cfe/trunk/test/Analysis/dynamic-cast.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/dynamic-cast.cpp?rev=154434&view=auto
>
> ==============================================================================
> --- cfe/trunk/test/Analysis/dynamic-cast.cpp (added)
> +++ cfe/trunk/test/Analysis/dynamic-cast.cpp Tue Apr 10 15:59:00 2012
>
[...]

> +// False negatives.
> +
> +// Symbolic regions are not typed, so we cannot deduce that the cast will
> +// always fail in this case.
>

The cast won't always fail:

class D : public B, public C {};
int main() {
  D d;
  testDynCastFail1(&d);
}

+int testDynCastFail1(class C *c) {
> +  B *b = 0;
> +  b = dynamic_cast<B*>(c);
> +  return b->m;
> +}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120410/227642bf/attachment.html>


More information about the cfe-commits mailing list