2012-09-01 01:06:49 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-ipa=inlining -analyzer-config c++-inlining=constructors -verify %s
|
2011-01-13 20:30:12 +08:00
|
|
|
|
2012-05-17 00:01:10 +08:00
|
|
|
void clang_analyzer_eval(bool);
|
|
|
|
|
2011-01-13 20:30:12 +08:00
|
|
|
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;
|
2012-05-17 00:01:10 +08:00
|
|
|
clang_analyzer_eval(b.getx() == 0); // expected-warning{{TRUE}}
|
2011-01-13 20:30:12 +08:00
|
|
|
}
|