summaryrefslogtreecommitdiffstats
path: root/test/Analysis/base-init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/base-init.cpp')
-rw-r--r--test/Analysis/base-init.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Analysis/base-init.cpp b/test/Analysis/base-init.cpp
new file mode 100644
index 0000000..800763b
--- /dev/null
+++ b/test/Analysis/base-init.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store region -analyzer-inline-call -cfg-add-initializers -verify %s
+
+class A {
+ int x;
+public:
+ A();
+ int getx() const {
+ return x;
+ }
+};
+
+A::A() : x(0) {
+}
+
+class B : public A {
+ int y;
+public:
+ B();
+};
+
+B::B() {
+}
+
+void f() {
+ B b;
+ if (b.getx() != 0) {
+ int *p = 0;
+ *p = 0; // no-warning
+ }
+}
OpenPOWER on IntegriCloud