[DFAJumpThreading] Remove incoming StartBlock from all phis when unfolding select...
[llvm-project.git] / clang-tools-extra / test / clang-tidy / infrastructure / nolintbeginend.cpp
blobae97bc5b51441202f962fa7805abc273fa65d250
1 // 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
3 class A { A(int i); };
4 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: single-argument constructors must be marked explicit
6 // NOLINTBEGIN
7 class B1 { B1(int i); };
8 // NOLINTEND
10 // NOLINTBEGIN
11 // NOLINTEND
12 // NOLINTBEGIN
13 class B2 { B2(int i); };
14 // NOLINTEND
16 // NOLINTBEGIN
17 // NOLINTBEGIN
18 class B3 { B3(int i); };
19 // NOLINTEND
20 // NOLINTEND
22 // NOLINTBEGIN
23 // NOLINTBEGIN
24 // NOLINTEND
25 class B4 { B4(int i); };
26 // NOLINTEND
28 // NOLINTBEGIN
29 // NOLINTEND
30 class B5 { B5(int i); };
31 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: single-argument constructors must be marked explicit
33 // NOLINTBEGIN(google-explicit-constructor)
34 class C1 { C1(int i); };
35 // NOLINTEND(google-explicit-constructor)
37 // NOLINTBEGIN()
38 class C2 { C2(int i); };
39 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: single-argument constructors must be marked explicit
40 // NOLINTEND()
42 // NOLINTBEGIN(*)
43 class C3 { C3(int i); };
44 // NOLINTEND(*)
46 // NOLINTBEGIN(some-other-check)
47 class C4 { C4(int i); };
48 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: single-argument constructors must be marked explicit
49 // NOLINTEND(some-other-check)
51 // NOLINTBEGIN(some-other-check, google-explicit-constructor)
52 class C5 { C5(int i); };
53 // NOLINTEND(some-other-check, google-explicit-constructor)
55 // NOLINTBEGIN(google-explicit-constructor)
56 // NOLINTBEGIN(some-other-check)
57 class C6 { C6(int i); };
58 // NOLINTEND(some-other-check)
59 // NOLINTEND(google-explicit-constructor)
61 // NOLINTBEGIN(google-explicit-constructor)
62 // NOLINTBEGIN
63 class C7 { C7(int i); };
64 // NOLINTEND
65 // NOLINTEND(google-explicit-constructor)
67 // NOLINTBEGIN
68 // NOLINTBEGIN(google-explicit-constructor)
69 class C8 { C8(int i); };
70 // NOLINTEND(google-explicit-constructor)
71 // NOLINTEND
73 // NOLINTBEGIN(not-closed-bracket-is-treated-as-skip-all
74 class C9 { C9(int i); };
75 // NOLINTEND(not-closed-bracket-is-treated-as-skip-all
77 // NOLINTBEGIN without-brackets-skip-all, another-check
78 class C10 { C10(int i); };
79 // NOLINTEND without-brackets-skip-all, another-check
81 #define MACRO(X) class X { X(int i); };
83 MACRO(D1)
84 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: single-argument constructors must be marked explicit
85 // CHECK-MESSAGES: :[[@LINE-4]]:28: note: expanded from macro 'MACRO
87 // NOLINTBEGIN
88 MACRO(D2)
89 // NOLINTEND
91 #define MACRO_NOARG class E { E(int i); };
93 // NOLINTBEGIN
94 MACRO_NOARG
95 // NOLINTEND
97 // NOLINTBEGIN
98 #define MACRO_WRAPPED_WITH_NO_LINT class I { I(int i); };
99 // NOLINTEND
101 MACRO_WRAPPED_WITH_NO_LINT
103 #define MACRO_NO_LINT_INSIDE_MACRO \
104 /* NOLINTBEGIN */ \
105 class J { J(int i); }; \
106 /* NOLINTEND */
108 MACRO_NO_LINT_INSIDE_MACRO
110 // NOLINTBEGIN(google*)
111 class C11 { C11(int i); };
112 // NOLINTEND(google*)
114 // NOLINTBEGIN(*explicit-constructor)
115 class C12 { C12(int i); };
116 // NOLINTEND(*explicit-constructor)
118 // NOLINTBEGIN(*explicit*)
119 class C13 { C13(int i); };
120 // NOLINTEND(*explicit*)
122 // NOLINTBEGIN(-explicit-constructor)
123 class C14 { C14(int x); };
124 // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: single-argument constructors must be marked explicit
125 // NOLINTEND(-explicit-constructor)
127 // NOLINTBEGIN(google*,-google*)
128 class C15 { C15(int x); };
129 // NOLINTEND(google*,-google*)
131 // NOLINTBEGIN(*,-google*)
132 class C16 { C16(int x); };
133 // NOLINTEND(*,-google*)
135 int array1[10];
136 // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays]
138 // NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays)
139 int array2[10];
140 // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: do not declare C-style arrays, use std::array<> instead [modernize-avoid-c-arrays]
141 // NOLINTEND(cppcoreguidelines-avoid-c-arrays)
143 // NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
144 int array3[10];
145 // NOLINTEND(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
147 // NOLINTBEGIN(*-avoid-c-arrays)
148 int array4[10];
149 // NOLINTEND(*-avoid-c-arrays)
151 // CHECK-MESSAGES: Suppressed 26 warnings (26 NOLINT).