Bug #: 12366
Summary: Dynamic cast false positive
Product: clang
Version: trunk
Platform: PC
OS/Version: MacOS X
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
AssignedTo: krem...@apple.com
ReportedBy: rol...@utk.edu
CC: llvm...@cs.uiuc.edu
Classification: Unclassified
class A {
virtual void f(){};
};
class B : public A{};
const int* f(A* a) {
B* b = dynamic_cast<B*>(a);
static const int i = 5;
if(b) {
return &i;
} else {
return 0;
}
}
int main(int argc, char** argv) {
B b;
return *f(&b);
}
with pre-compiled binary 263 gives:
warning: Dereference of null pointer
return *f(&b);
^~~~~~
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVM...@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs