summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/derived-to-base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/derived-to-base.cpp')
-rw-r--r--clang/test/Analysis/derived-to-base.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Analysis/derived-to-base.cpp b/clang/test/Analysis/derived-to-base.cpp
new file mode 100644
index 0000000..f65b9db
--- /dev/null
+++ b/clang/test/Analysis/derived-to-base.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region %s
+
+class A {
+protected:
+ int x;
+};
+
+class B : public A {
+public:
+ void f();
+};
+
+void B::f() {
+ x = 3;
+}