summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/cast-value-logic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/cast-value-logic.cpp')
-rw-r--r--clang/test/Analysis/cast-value-logic.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/test/Analysis/cast-value-logic.cpp b/clang/test/Analysis/cast-value-logic.cpp
index 531772825f9..221ae7f9ae3 100644
--- a/clang/test/Analysis/cast-value-logic.cpp
+++ b/clang/test/Analysis/cast-value-logic.cpp
@@ -19,7 +19,11 @@ struct Shape {
virtual double area();
};
class Triangle : public Shape {};
-class Circle : public Shape {};
+class Circle : public Shape {
+public:
+ ~Circle();
+};
+class SuspiciouslySpecificCircle : public Circle {};
} // namespace clang
using namespace llvm;
@@ -149,4 +153,10 @@ double test_virtual_method_after_call(Shape *S) {
return S->area();
return S->area() / 2;
}
+
+void test_delete_crash() {
+ extern Circle *makeCircle();
+ Shape *S = makeCircle();
+ delete cast<SuspiciouslySpecificCircle>(S);
+}
} // namespace crashes
OpenPOWER on IntegriCloud