1 | // RUN: clang-tidy -checks='-*,google-explicit-constructor' -line-filter='[{"name":"line-filter.cpp","lines":[[18,18],[22,22]]},{"name":"header1.h","lines":[[1,2]]},{"name":"header2.h"},{"name":"header3.h"}]' -header-filter='header[12]\.h$' %s -- -I %S/Inputs/line-filter 2>&1 | FileCheck %s |
2 | |
3 | #include "header1.h" |
4 | // CHECK-NOT: header1.h:{{.*}} warning |
5 | // CHECK: header1.h:1:12: warning: single-argument constructors must be marked explicit |
6 | // CHECK: header1.h:2:12: warning: single-argument constructors {{.*}} |
7 | // CHECK-NOT: header1.h:{{.*}} warning |
8 | |
9 | #include "header2.h" |
10 | // CHECK: header2.h:1:12: warning: single-argument constructors {{.*}} |
11 | // CHECK: header2.h:2:12: warning: single-argument constructors {{.*}} |
12 | // CHECK: header2.h:3:12: warning: single-argument constructors {{.*}} |
13 | // CHECK-NOT: header2.h:{{.*}} warning |
14 | |
15 | #include "header3.h" |
16 | // CHECK-NOT: header3.h:{{.*}} warning |
17 | |
18 | class A { A(int); }; |
19 | // CHECK: :[[@LINE-1]]:11: warning: single-argument constructors {{.*}} |
20 | class B { B(int); }; |
21 | // CHECK-NOT: :[[@LINE-1]]:{{.*}} warning |
22 | class C { C(int); }; |
23 | // CHECK: :[[@LINE-1]]:11: warning: single-argument constructors {{.*}} |
24 | |
25 | // CHECK-NOT: warning: |
26 | |
27 | // CHECK: Suppressed 3 warnings (1 in non-user code, 2 due to line filter) |
28 | |