mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00

The idea is to eventually place all analyzer options under "analyzer-config". In addition, this lays the ground for introduction of a high-level analyzer mode option, which will influence the default setting for IPAMode. llvm-svn: 173385
21 lines
494 B
C++
21 lines
494 B
C++
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s
|
|
|
|
void clang_analyzer_eval(bool);
|
|
|
|
typedef struct Opaque *Data;
|
|
struct IntWrapper {
|
|
int x;
|
|
};
|
|
|
|
struct Child : public IntWrapper {
|
|
void set() { x = 42; }
|
|
};
|
|
|
|
void test(Data data) {
|
|
Child *wrapper = reinterpret_cast<Child*>(data);
|
|
// Don't crash when upcasting here.
|
|
// We don't actually know if 'data' is a Child.
|
|
wrapper->set();
|
|
clang_analyzer_eval(wrapper->x == 42); // expected-warning{{TRUE}}
|
|
}
|