-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Fix incorrect link to "note" diagnostics in HTML output
IDs of the note list start from 1. Link generated for each note started with index 0 i.e #Note0, #Note1 and so on. As a result, first link ("#Note0") was invalid, subsequent links pointed at wrong note. Now, generated links to the notes start with index 1 i.e (#Note1, #Note2 and so on. Patch by Guruprasad Hegde (gruuprasad)! Fixes #64054 Differential Revision: https://reviews.llvm.org/D156724
- Loading branch information
1 parent
a1f04b7
commit e73ae74
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// RUN: rm -fR %t | ||
// RUN: mkdir %t | ||
// RUN: %clang_analyze_cc1 -analyzer-checker=optin.cplusplus.UninitializedObject \ | ||
// RUN: -analyzer-output=html -o %t -verify %s | ||
// RUN: cat %t/report-*.html | FileCheck %s | ||
|
||
struct A { | ||
int *iptr; | ||
int a; // expected-note{{uninitialized field 'this->a'}} | ||
int b; // expected-note{{uninitialized field 'this->b'}} | ||
|
||
A (int *iptr) : iptr(iptr) {} // expected-warning{{2 uninitialized fields at the end of the constructor call [optin.cplusplus.UninitializedObject]}} | ||
}; | ||
|
||
void f() { | ||
A a(0); | ||
} | ||
|
||
//CHECK: <tr><td class="rowname">Note:</td> | ||
//CHECK-NOT: <a href="#Note0"> | ||
//CHECK-SAME: <a href="#Note1">line 9, column 7</a> | ||
//CHECK-SAME: <a href="#Note2">line 10, column 7</a> |