1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,optin.cplusplus.UninitializedObject \
2 // RUN:   -std=c++11 -DPEDANTIC -verify %s
3 
4 class UninitPointerTest {
5   int *ptr; // expected-note{{uninitialized pointer 'this->ptr'}}
6   int dontGetFilteredByNonPedanticMode = 0;
7 
8 public:
UninitPointerTest()9   UninitPointerTest() {} // expected-warning{{1 uninitialized field}}
10 };
11 
fUninitPointerTest()12 void fUninitPointerTest() {
13   UninitPointerTest();
14 }
15 
16 class UninitPointeeTest {
17   int *ptr; // no-note
18   int dontGetFilteredByNonPedanticMode = 0;
19 
20 public:
UninitPointeeTest(int * ptr)21   UninitPointeeTest(int *ptr) : ptr(ptr) {} // no-warning
22 };
23 
fUninitPointeeTest()24 void fUninitPointeeTest() {
25   int a;
26   UninitPointeeTest t(&a);
27 }
28