@@ -16,7 +16,7 @@ struct TestClass {
16
16
void DecomposeByAssignWarnCases () {
17
17
{
18
18
auto P = getPair<int , int >();
19
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
19
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
20
20
// CHECK-FIXES-ALL: auto [x, y] = getPair<int, int>();
21
21
int x = P.first ;
22
22
int y = P.second ; // REMOVE
@@ -25,15 +25,15 @@ void DecomposeByAssignWarnCases() {
25
25
26
26
{
27
27
auto P = getPair<int , int >();
28
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
28
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
29
29
// CHECK-FIXES-ALL: auto [x, y] = getPair<int, int>();
30
30
int x = P.first , y = P.second ; // REMOVE
31
31
// CHECK-FIXES-ALL: // REMOVE
32
32
}
33
33
34
34
{
35
35
auto P = getPair<int , int >();
36
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
36
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
37
37
// CHECK-FIXES-ALL: auto [x, y] = getPair<int, int>();
38
38
int x = P.first , y = P.second ; // REMOVE
39
39
// CHECK-FIXES-ALL: // REMOVE
@@ -42,7 +42,7 @@ void DecomposeByAssignWarnCases() {
42
42
43
43
{
44
44
auto P = getPair<int , int >();
45
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
45
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
46
46
// CHECK-FIXES-ALL: auto [x, y] = getPair<int, int>();
47
47
int x = P.first ;
48
48
auto y = P.second ; // REMOVE
@@ -51,7 +51,7 @@ void DecomposeByAssignWarnCases() {
51
51
52
52
{
53
53
const auto P = getPair<int , int >();
54
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
54
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
55
55
// CHECK-FIXES-ALL: const auto [x, y] = getPair<int, int>();
56
56
const int x = P.first ;
57
57
const auto y = P.second ; // REMOVE
@@ -61,7 +61,7 @@ void DecomposeByAssignWarnCases() {
61
61
{
62
62
std::pair<int , int > otherP;
63
63
auto & P = otherP;
64
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
64
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
65
65
// CHECK-FIXES-ALL: auto& [x, y] = otherP;
66
66
int & x = P.first ;
67
67
auto & y = P.second ; // REMOVE
@@ -71,7 +71,7 @@ void DecomposeByAssignWarnCases() {
71
71
{
72
72
std::pair<int , int > otherP;
73
73
const auto & P = otherP;
74
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
74
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:5: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
75
75
// CHECK-FIXES-ALL: const auto& [x, y] = otherP;
76
76
const int & x = P.first ;
77
77
const auto & y = P.second ; // REMOVE
@@ -82,46 +82,46 @@ void DecomposeByAssignWarnCases() {
82
82
void forRangeWarnCases () {
83
83
std::pair<int , int > Pairs[10 ];
84
84
for (auto P : Pairs) {
85
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
85
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
86
86
// CHECK-FIXES-ALL: for (auto [x, y] : Pairs) {
87
87
int x = P.first ;
88
88
int y = P.second ; // REMOVE
89
89
// CHECK-FIXES-ALL: // REMOVE
90
90
}
91
91
92
92
for (auto P : Pairs) {
93
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
93
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
94
94
// CHECK-FIXES-ALL: for (auto [x, y] : Pairs) {
95
95
int x = P.first , y = P.second ; // REMOVE
96
96
// CHECK-FIXES-ALL: // REMOVE
97
97
}
98
98
99
99
for (auto P : Pairs) {
100
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
100
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
101
101
// CHECK-FIXES-ALL: for (auto [x, y] : Pairs) {
102
102
int x = P.first , y = P.second ; // REMOVE
103
103
// CHECK-FIXES-ALL: // REMOVE
104
104
int z;
105
105
}
106
106
107
107
for (const auto P : Pairs) {
108
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
108
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
109
109
// CHECK-FIXES-ALL: for (const auto [x, y] : Pairs) {
110
110
const int x = P.first ;
111
111
const int y = P.second ; // REMOVE
112
112
// CHECK-FIXES-ALL: // REMOVE
113
113
}
114
114
115
115
for (auto & P : Pairs) {
116
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
116
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
117
117
// CHECK-FIXES-ALL: for (auto& [x, y] : Pairs) {
118
118
int & x = P.first ;
119
119
int & y = P.second ; // REMOVE
120
120
// CHECK-FIXES-ALL: // REMOVE
121
121
}
122
122
123
123
for (const auto & P : Pairs) {
124
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
124
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
125
125
// CHECK-FIXES-ALL: for (const auto& [x, y] : Pairs) {
126
126
const int & x = P.first ;
127
127
const int & y = P.second ; // REMOVE
@@ -130,15 +130,15 @@ void forRangeWarnCases() {
130
130
131
131
std::pair<TestClass, TestClass> ClassPairs[10 ];
132
132
for (auto P : ClassPairs) {
133
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
133
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
134
134
// CHECK-FIXES-ALL: for (auto [c1, c2] : ClassPairs) {
135
135
TestClass c1 = P.first ;
136
136
TestClass c2 = P.second ; // REMOVE
137
137
// CHECK-FIXES-ALL: // REMOVE
138
138
}
139
139
140
140
for (const auto P : ClassPairs) {
141
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
141
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
142
142
// CHECK-FIXES-ALL: for (const auto [c1, c2] : ClassPairs) {
143
143
const TestClass c1 = P.first ;
144
144
const TestClass c2 = P.second ; // REMOVE
@@ -186,27 +186,27 @@ void stdTieWarnCases() {
186
186
int b = 0 ; // REMOVE
187
187
// CHECK-FIXES-ALL: // REMOVE
188
188
std::tie (a, b) = getPair<int , int >();
189
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
189
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
190
190
// CHECK-FIXES-ALL: auto [a, b] = getPair<int, int>();
191
191
192
192
int x = 0 , y = 0 ; // REMOVE
193
193
// CHECK-FIXES-ALL: // REMOVE
194
194
std::tie (x, y) = getPair<int , int >();
195
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
195
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
196
196
// CHECK-FIXES-ALL: auto [x, y] = getPair<int, int>();
197
197
198
198
int * pa = nullptr ;
199
199
int * pb = nullptr ; // REMOVE
200
200
// CHECK-FIXES-ALL: // REMOVE
201
201
std::tie (pa, pb) = getPair<int *, int *>();
202
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
202
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
203
203
// CHECK-FIXES-ALL: auto [pa, pb] = getPair<int*, int*>();
204
204
205
205
TestClass c1 (1 , 2 );
206
206
TestClass c2 = TestClass {3 , 4 }; // REMOVE
207
207
// CHECK-FIXES-ALL: // REMOVE
208
208
std::tie (c1, c2) = getPair<TestClass, TestClass>();
209
- // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
209
+ // CHECK-MESSAGES-ALL: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
210
210
// CHECK-FIXES-ALL: auto [c1, c2] = getPair<TestClass, TestClass>();
211
211
}
212
212
@@ -309,7 +309,7 @@ void NotWarnForMacro2() {
309
309
310
310
void captureByVal () {
311
311
auto P = getPair<int , int >();
312
- // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
312
+ // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
313
313
// CHECK-FIXES-CPP20ORLATER: auto [x, y] = getPair<int, int>();
314
314
int x = P.first ;
315
315
int y = P.second ; // REMOVE
@@ -322,7 +322,7 @@ void captureByVal() {
322
322
323
323
void captureByRef () {
324
324
auto P = getPair<int , int >();
325
- // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
325
+ // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
326
326
// CHECK-FIXES-CPP20ORLATER: auto [x, y] = getPair<int, int>();
327
327
int x = P.first ;
328
328
int y = P.second ; // REMOVE
@@ -335,7 +335,7 @@ void captureByRef() {
335
335
336
336
void captureByAllRef () {
337
337
auto P = getPair<int , int >();
338
- // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
338
+ // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
339
339
// CHECK-FIXES-CPP20ORLATER: auto [x, y] = getPair<int, int>();
340
340
int x = P.first ;
341
341
int y = P.second ; // REMOVE
@@ -348,7 +348,7 @@ void captureByAllRef() {
348
348
349
349
void deepLambda () {
350
350
auto P = getPair<int , int >();
351
- // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
351
+ // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
352
352
// CHECK-FIXES-CPP20ORLATER: auto [x, y] = getPair<int, int>();
353
353
int x = P.first ;
354
354
int y = P.second ; // REMOVE
@@ -364,7 +364,7 @@ void deepLambda() {
364
364
void forRangeNotWarn () {
365
365
std::pair<int , int > Pairs[10 ];
366
366
for (auto P : Pairs) {
367
- // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
367
+ // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:8: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
368
368
// CHECK-FIXES-CPP20ORLATER: for (auto [x, y] : Pairs) {
369
369
int x = P.first ;
370
370
int y = P.second ; // REMOVE
@@ -381,7 +381,7 @@ void stdTieNotWarn() {
381
381
int y = 0 ; // REMOVE
382
382
// CHECK-FIXES-CPP20ORLATER: // REMOVE
383
383
std::tie (x, y) = getPair<int , int >();
384
- // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
384
+ // CHECK-MESSAGES-CPP20ORLATER: :[[@LINE-1]]:3: warning: use a structured binding to decompose a pair [modernize-use-structured-binding]
385
385
// CHECK-FIXES-CPP20ORLATER: auto [x, y] = getPair<int, int>();
386
386
387
387
auto lambda = [&x]() {
0 commit comments