forked from OSchip/llvm-project
[analyzer] Re-add reinterpret_cast virtual call test case from r163644.
We mostly just don't want to crash analyzing this test case; it's likely the code found here will actually crash if compiled and run. llvm-svn: 163746
This commit is contained in:
parent
d44977ef64
commit
2010d437f9
|
@ -15,3 +15,19 @@ void testKnown() {
|
|||
A a;
|
||||
clang_analyzer_eval(a.get() == 0); // expected-warning{{TRUE}}
|
||||
}
|
||||
|
||||
|
||||
namespace ReinterpretDisruptsDynamicTypeInfo {
|
||||
class Parent {};
|
||||
|
||||
class Child : public Parent {
|
||||
public:
|
||||
virtual int foo() { return 42; }
|
||||
};
|
||||
|
||||
void test(Parent *a) {
|
||||
Child *b = reinterpret_cast<Child *>(a);
|
||||
if (!b) return;
|
||||
clang_analyzer_eval(b->foo() == 42); // expected-warning{{UNKNOWN}}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue