[analyzer] CastValueChecker: Provide DynamicTypeMap with pointer types only.
The idea to drop this requirement is good, but for now every other user
of DynamicTypeInfo expects pointer types.
Fixes a crash.
llvm-svn: 369728
diff --git a/clang/test/Analysis/cast-value-logic.cpp b/clang/test/Analysis/cast-value-logic.cpp
index c5083ef5..5317728 100644
--- a/clang/test/Analysis/cast-value-logic.cpp
+++ b/clang/test/Analysis/cast-value-logic.cpp
@@ -15,6 +15,8 @@
template <typename T>
const T *getAs() const;
+
+ virtual double area();
};
class Triangle : public Shape {};
class Circle : public Shape {};
@@ -141,4 +143,10 @@
auto P = foo();
auto Q = cast<Circle>(std::move(P)); // no-crash
}
+
+double test_virtual_method_after_call(Shape *S) {
+ if (isa<Circle>(S))
+ return S->area();
+ return S->area() / 2;
+}
} // namespace crashes