Files
llvm-project/clang/test/Analysis/base-init.cpp
Ted Kremenek 98a24e37c5 Begin reworking static analyzer support for C++ method calls. The current logic was divorced
from how we process ordinary function calls, had a tremendous about of redundancy, and relied
strictly on inlining behavior (which was incomplete) to provide semantics instead of falling
back to the conservative analysis we use for C functions.  This is a significant step into
making C++ analyzer support more useful.

llvm-svn: 128557
2011-03-30 17:41:19 +00:00

32 lines
388 B
C++

// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region -analyzer-inline-call -cfg-add-initializers -verify %s
// XFAIL: *
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
}
}