@@ -15,23 +15,23 @@ struct TestClass {
15
15
void DecomposeByAssignWarnCases () {
16
16
{
17
17
auto P = getPair<int , int >();
18
- // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
18
+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
19
19
// CHECK-FIXES: {{^}} auto [x, y] = getPair<int, int>();
20
20
int x = P.first ;
21
21
int y = P.second ;
22
22
}
23
23
24
24
{
25
25
auto P = getPair<int , int >();
26
- // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
26
+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
27
27
// CHECK-FIXES: {{^}} auto [x, y] = getPair<int, int>();
28
28
int x = P.first ;
29
29
auto y = P.second ;
30
30
}
31
31
32
32
{
33
33
const auto P = getPair<int , int >();
34
- // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
34
+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
35
35
// CHECK-FIXES: {{^}} const auto [x, y] = getPair<int, int>();
36
36
const int x = P.first ;
37
37
const auto y = P.second ;
@@ -40,7 +40,7 @@ void DecomposeByAssignWarnCases() {
40
40
{
41
41
std::pair<int , int > otherP;
42
42
auto & P = otherP;
43
- // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
43
+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
44
44
// CHECK-FIXES: {{^}} auto& [x, y] = otherP;
45
45
int & x = P.first ;
46
46
auto & y = P.second ;
@@ -49,7 +49,7 @@ void DecomposeByAssignWarnCases() {
49
49
{
50
50
std::pair<int , int > otherP;
51
51
const auto & P = otherP;
52
- // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
52
+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
53
53
// CHECK-FIXES: {{^}} const auto& [x, y] = otherP;
54
54
const int & x = P.first ;
55
55
const auto & y = P.second ;
@@ -59,43 +59,43 @@ void DecomposeByAssignWarnCases() {
59
59
void forRangeWarnCases () {
60
60
std::pair<int , int > Pairs[10 ];
61
61
for (auto P : Pairs) {
62
- // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
62
+ // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
63
63
// CHECK-FIXES: {{^}} for (auto [x, y] : Pairs) {
64
64
int x = P.first ;
65
65
int y = P.second ;
66
66
}
67
67
68
68
for (const auto P : Pairs) {
69
- // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
69
+ // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
70
70
// CHECK-FIXES: {{^}} for (const auto [x, y] : Pairs) {
71
71
const int x = P.first ;
72
72
const int y = P.second ;
73
73
}
74
74
75
75
for (auto & P : Pairs) {
76
- // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
76
+ // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
77
77
// CHECK-FIXES: {{^}} for (auto& [x, y] : Pairs) {
78
78
int & x = P.first ;
79
79
int & y = P.second ;
80
80
}
81
81
82
82
for (const auto & P : Pairs) {
83
- // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
83
+ // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
84
84
// CHECK-FIXES: {{^}} for (const auto& [x, y] : Pairs) {
85
85
const int & x = P.first ;
86
86
const int & y = P.second ;
87
87
}
88
88
89
89
std::pair<TestClass, TestClass> ClassPairs[10 ];
90
90
for (auto P : ClassPairs) {
91
- // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
91
+ // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
92
92
// CHECK-FIXES: {{^}} for (auto [c1, c2] : ClassPairs) {
93
93
TestClass c1 = P.first ;
94
94
TestClass c2 = P.second ;
95
95
}
96
96
97
97
for (const auto P : ClassPairs) {
98
- // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
98
+ // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
99
99
// CHECK-FIXES: {{^}} for (const auto [c1, c2] : ClassPairs) {
100
100
const TestClass c1 = P.first ;
101
101
const TestClass c2 = P.second ;
@@ -106,19 +106,19 @@ void stdTieWarnCases() {
106
106
int a = 0 ;
107
107
int b = 0 ;
108
108
std::tie (a, b) = getPair<int , int >();
109
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
109
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
110
110
// CHECK-FIXES: {{^}} auto [a, b] = getPair<int, int>();
111
111
112
112
int * pa = nullptr ;
113
113
int * pb = nullptr ;
114
114
std::tie (pa, pb) = getPair<int *, int *>();
115
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
115
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
116
116
// CHECK-FIXES: {{^}} auto [pa, pb] = getPair<int*, int*>();
117
117
118
118
TestClass c1 (1 , 2 );
119
119
TestClass c2 = TestClass {3 , 4 };
120
120
std::tie (c1, c2) = getPair<TestClass, TestClass>();
121
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: Should use structured binding to decompose pair [modernize-use-structured-binding]
121
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
122
122
// CHECK-FIXES: {{^}} auto [c1, c2] = getPair<TestClass, TestClass>();
123
123
}
124
124
0 commit comments