From: Anna Zaks Date: Wed, 11 Apr 2012 22:29:38 +0000 (+0000) Subject: [analyzer] Another dynamic_cast false positive/negative. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3fa98f67038bec98651f833b685c104ef6438ab;p=clang [analyzer] Another dynamic_cast false positive/negative. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154543 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/dynamic-cast.cpp b/test/Analysis/dynamic-cast.cpp index 62481e3635..8e63b2bcb3 100644 --- a/test/Analysis/dynamic-cast.cpp +++ b/test/Analysis/dynamic-cast.cpp @@ -221,3 +221,10 @@ int testDynCastFalsePositive(BB *c) { return *res; // expected-warning{{Dereference of null pointer}} } +// Does not work when we new an object. +int testDynCastFail3() { + A *a = new A(); + B *b = dynamic_cast(a); + return b->m; +} +