summaryrefslogtreecommitdiff
path: root/test/Analysis/derived-to-base.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-11-26 08:21:53 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-11-26 08:21:53 +0000
commit4fd56816e0925c04f2c92e75399f5c9018d5d6fb (patch)
treeeb577fcd8de27fc7ae4f6bb183b07801aef22f07 /test/Analysis/derived-to-base.cpp
parentdc1ad2ce2acbf9d99061a40980c83715ad39f0f0 (diff)
downloadclang-4fd56816e0925c04f2c92e75399f5c9018d5d6fb.tar.gz
Regionstore: support derived-to-base cast by creating a CXXBaseObjectRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/derived-to-base.cpp')
-rw-r--r--test/Analysis/derived-to-base.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/derived-to-base.cpp b/test/Analysis/derived-to-base.cpp
new file mode 100644
index 0000000000..2a9244ef34
--- /dev/null
+++ b/test/Analysis/derived-to-base.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store region %s
+
+class A {
+protected:
+ int x;
+};
+
+class B : public A {
+public:
+ void f();
+};
+
+void B::f() {
+ x = 3;
+}