Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clang-tidy -header-filter option
Summary: Add clang-tidy -header-filter option to specify from which headers we want diagnostics to be printed. By default we don't print diagnostics from headers. We always print diagnostics from the main file of each translation unit. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D3590 llvm-svn: 207970
- Loading branch information
Showing
7 changed files
with
64 additions
and
6 deletions.
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
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
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 @@ | ||
class A1 { A1(int); }; |
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 @@ | ||
class A2 { A2(int); }; |
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: clang-tidy -checks=google-explicit-constructor -disable-checks='' -header-filter='' %s -- -I %S/Inputs/file-filter | FileCheck %s | ||
// RUN: clang-tidy -checks=google-explicit-constructor -disable-checks='' -header-filter='.*' %s -- -I %S/Inputs/file-filter | FileCheck --check-prefix=CHECK2 %s | ||
// RUN: clang-tidy -checks=google-explicit-constructor -disable-checks='' -header-filter='header2\.h' %s -- -I %S/Inputs/file-filter | FileCheck --check-prefix=CHECK3 %s | ||
|
||
#include "header1.h" | ||
// CHECK-NOT: warning: | ||
// CHECK2: header1.h:1:12: warning: Single-argument constructors must be explicit [google-explicit-constructor] | ||
// CHECK3-NOT: warning: | ||
|
||
#include "header2.h" | ||
// CHECK-NOT: warning: | ||
// CHECK2: header2.h:1:12: warning: Single-argument constructors {{.*}} | ||
// CHECK3: header2.h:1:12: warning: Single-argument constructors {{.*}} | ||
|
||
class A { A(int); }; | ||
// CHECK: :[[@LINE-1]]:11: warning: Single-argument constructors {{.*}} | ||
// CHECK2: :[[@LINE-2]]:11: warning: Single-argument constructors {{.*}} | ||
// CHECK3: :[[@LINE-3]]:11: warning: Single-argument constructors {{.*}} | ||
|
||
// CHECK-NOT: warning: | ||
// CHECK2-NOT: warning: | ||
// CHECK3-NOT: warning: |