mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-11 00:31:09 +00:00
219c9d0dd3
More generally, this adds a new configuration option 'c++-inlining', which controls which C++ member functions can be considered for inlining. This uses the new -analyzer-config table, so the cc1 arguments will look like this: ... -analyzer-config c++-inlining=[none|methods|constructors|destructors] Note that each mode implies that all the previous member function kinds will be inlined as well; it doesn't make sense to inline destructors without inlining constructors, for example. The default mode is 'methods'. llvm-svn: 163004
30 lines
426 B
C++
30 lines
426 B
C++
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-ipa=inlining -analyzer-config c++-inlining=constructors -verify %s
|
|
|
|
void clang_analyzer_eval(bool);
|
|
|
|
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;
|
|
clang_analyzer_eval(b.getx() == 0); // expected-warning{{TRUE}}
|
|
}
|