llvm-capstone/clang/test/Analysis/cxx-uninitialized-object-notes-as-warnings.cpp
Kristof Umann a3f7b58742 [analyzer][UninitializedObjectChecker] New flag to turn off dereferencing
Even for a checker being in alpha, some reports about pointees held so little
value to the user that it's safer to disable pointer/reference chasing for now.
It can be enabled with a new flag, in which case checker should function as it
has always been. This can be set with `CheckPointeeInitialization`.

Differential Revision: https://reviews.llvm.org/D49438

llvm-svn: 339135
2018-08-07 12:55:26 +00:00

19 lines
602 B
C++

// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.cplusplus.UninitializedObject \
// RUN: -analyzer-config alpha.cplusplus.UninitializedObject:NotesAsWarnings=true \
// RUN: -analyzer-config alpha.cplusplus.UninitializedObject:CheckPointeeInitialization=true \
// RUN: -std=c++11 -verify %s
class NotesAsWarningsTest {
int a;
int b;
int dontGetFilteredByNonPedanticMode = 0;
public:
NotesAsWarningsTest() {} // expected-warning{{uninitialized field 'this->a'}}
// expected-warning@-1{{uninitialized field 'this->b'}}
};
void fNotesAsWarningsTest() {
NotesAsWarningsTest();
}