mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 19:49:36 +00:00
85e0ff752c
Moved UninitializedObjectChecker from the 'alpha.cplusplus' to the 'optin.cplusplus' package. Differential Revision: https://reviews.llvm.org/D58573 llvm-svn: 358797
28 lines
635 B
C++
28 lines
635 B
C++
// RUN: %clang_analyze_cc1 -analyzer-checker=core,optin.cplusplus.UninitializedObject \
|
|
// RUN: -std=c++11 -DPEDANTIC -verify %s
|
|
|
|
class UninitPointerTest {
|
|
int *ptr; // expected-note{{uninitialized pointer 'this->ptr'}}
|
|
int dontGetFilteredByNonPedanticMode = 0;
|
|
|
|
public:
|
|
UninitPointerTest() {} // expected-warning{{1 uninitialized field}}
|
|
};
|
|
|
|
void fUninitPointerTest() {
|
|
UninitPointerTest();
|
|
}
|
|
|
|
class UninitPointeeTest {
|
|
int *ptr; // no-note
|
|
int dontGetFilteredByNonPedanticMode = 0;
|
|
|
|
public:
|
|
UninitPointeeTest(int *ptr) : ptr(ptr) {} // no-warning
|
|
};
|
|
|
|
void fUninitPointeeTest() {
|
|
int a;
|
|
UninitPointeeTest t(&a);
|
|
}
|