| 1 |
// RUN: rm -fR %t |
| 2 |
// RUN: mkdir %t |
| 3 |
// RUN: %clang_analyze_cc1 -analyzer-checker=optin.cplusplus.UninitializedObject \ |
| 4 |
// RUN: -analyzer-output=html -o %t -verify %s |
| 5 |
// RUN: cat %t/report-*.html | FileCheck %s |
| 6 |
|
| 7 |
struct A { |
| 8 |
int *iptr; |
| 9 |
int a; // expected-note{{uninitialized field 'this->a'}} |
| 10 |
int b; // expected-note{{uninitialized field 'this->b'}} |
| 11 |
|
| 12 |
A (int *iptr) : iptr(iptr) {} // expected-warning{{2 uninitialized fields at the end of the constructor call [optin.cplusplus.UninitializedObject]}} |
| 13 |
}; |
| 14 |
|
| 15 |
void f() { |
| 16 |
A a(0); |
| 17 |
} |
| 18 |
|
| 19 |
//CHECK: <tr><td class="rowname">Note:</td> |
| 20 |
//CHECK-NOT: <a href="#Note0"> |
| 21 |
//CHECK-SAME: <a href="#Note1">line 9, column 7</a> |
| 22 |
//CHECK-SAME: <a href="#Note2">line 10, column 7</a> |