2017-03-03 06:58:06 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -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
|
|
|
}
|