1// NOLINTNEXTLINE
2class A { A(int i); };
3
4class B { B(int i); };
5// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: single-argument constructors must be marked explicit
6
7// NOLINTNEXTLINE
8class C { C(int i); };
9
10// NOLINTNEXTLINE(for-some-other-check)
11class D { D(int i); };
12// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: single-argument constructors must be marked explicit
13
14// NOLINTNEXTLINE()
15class D1 { D1(int i); };
16// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: single-argument constructors must be marked explicit
17
18// NOLINTNEXTLINE(*)
19class D2 { D2(int i); };
20
21// NOLINTNEXTLINE(not-closed-bracket-is-treated-as-skip-all
22class D3 { D3(int i); };
23
24// NOLINTNEXTLINE(google-explicit-constructor)
25class D4 { D4(int i); };
26
27// NOLINTNEXTLINE(some-check, google-explicit-constructor)
28class D5 { D5(int i); };
29
30// NOLINTNEXTLINE without-brackets-skip-all, another-check
31class D6 { D6(int i); };
32
33// NOLINTNEXTLINE
34
35class E { E(int i); };
36// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: single-argument constructors must be marked explicit
37
38// NOLINTNEXTLINE
39//
40class F { F(int i); };
41// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: single-argument constructors must be marked explicit
42
43#define MACRO(X) class X { X(int i); };
44MACRO(G)
45// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: single-argument constructors must be marked explicit
46// NOLINTNEXTLINE
47MACRO(H)
48
49#define MACRO_NOARG class I { I(int i); };
50// NOLINTNEXTLINE
51MACRO_NOARG
52
53// NOLINTNEXTLINE(google*)
54class I1 { I1(int i); };
55
56// NOLINTNEXTLINE(*explicit-constructor)
57class I2 { I2(int i); };
58
59// NOLINTNEXTLINE(*explicit*)
60class I3 { I3(int i); };
61
62// NOLINTNEXTLINE(-explicit-constructor)
63class I4 { I4(int x); };
64// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: single-argument constructors must be marked explicit
65
66// NOLINTNEXTLINE(google*,-google*)
67class I5 { I5(int x); };
68
69// NOLINTNEXTLINE(*,-google*)
70class I6 { I6(int x); };
71
72int array1[10];
73// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays]
74
75// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays)
76int array2[10];
77// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: do not declare C-style arrays, use std::array<> instead [modernize-avoid-c-arrays]
78
79// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
80int array3[10];
81
82// NOLINTNEXTLINE(*-avoid-c-arrays)
83int array4[10];
84
85// CHECK-MESSAGES: Suppressed 19 warnings (19 NOLINT)
86
87// RUN: %check_clang_tidy %s google-explicit-constructor,clang-diagnostic-unused-variable,cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays %t -- -extra-arg=-Wunused-variable
88

source code of clang-tools-extra/test/clang-tidy/infrastructure/nolintnextline.cpp