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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163746
91177308-0d34-0410-b5e6-
96231b3b80d8
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}}
+ }
+}