@@ -16,23 +16,23 @@ void DecomposeByAssignWarnCases() {
1616 {
1717 auto P = getPair<int , int >();
1818 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
19- // CHECK-FIXES: {{^}} auto [x, y] = getPair<int, int>();
19+ // CHECK-FIXES: auto [x, y] = getPair<int, int>();
2020 int x = P.first ;
2121 int y = P.second ;
2222 }
2323
2424 {
2525 auto P = getPair<int , int >();
2626 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
27- // CHECK-FIXES: {{^}} auto [x, y] = getPair<int, int>();
27+ // CHECK-FIXES: auto [x, y] = getPair<int, int>();
2828 int x = P.first ;
2929 auto y = P.second ;
3030 }
3131
3232 {
3333 const auto P = getPair<int , int >();
3434 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
35- // CHECK-FIXES: {{^}} const auto [x, y] = getPair<int, int>();
35+ // CHECK-FIXES: const auto [x, y] = getPair<int, int>();
3636 const int x = P.first ;
3737 const auto y = P.second ;
3838 }
@@ -41,7 +41,7 @@ void DecomposeByAssignWarnCases() {
4141 std::pair<int , int > otherP;
4242 auto & P = otherP;
4343 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
44- // CHECK-FIXES: {{^}} auto& [x, y] = otherP;
44+ // CHECK-FIXES: auto& [x, y] = otherP;
4545 int & x = P.first ;
4646 auto & y = P.second ;
4747 }
@@ -50,7 +50,7 @@ void DecomposeByAssignWarnCases() {
5050 std::pair<int , int > otherP;
5151 const auto & P = otherP;
5252 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
53- // CHECK-FIXES: {{^}} const auto& [x, y] = otherP;
53+ // CHECK-FIXES: const auto& [x, y] = otherP;
5454 const int & x = P.first ;
5555 const auto & y = P.second ;
5656 }
@@ -60,43 +60,43 @@ void forRangeWarnCases() {
6060 std::pair<int , int > Pairs[10 ];
6161 for (auto P : Pairs) {
6262 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
63- // CHECK-FIXES: {{^}} for (auto [x, y] : Pairs) {
63+ // CHECK-FIXES: for (auto [x, y] : Pairs) {
6464 int x = P.first ;
6565 int y = P.second ;
6666 }
6767
6868 for (const auto P : Pairs) {
6969 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
70- // CHECK-FIXES: {{^}} for (const auto [x, y] : Pairs) {
70+ // CHECK-FIXES: for (const auto [x, y] : Pairs) {
7171 const int x = P.first ;
7272 const int y = P.second ;
7373 }
7474
7575 for (auto & P : Pairs) {
7676 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
77- // CHECK-FIXES: {{^}} for (auto& [x, y] : Pairs) {
77+ // CHECK-FIXES: for (auto& [x, y] : Pairs) {
7878 int & x = P.first ;
7979 int & y = P.second ;
8080 }
8181
8282 for (const auto & P : Pairs) {
8383 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
84- // CHECK-FIXES: {{^}} for (const auto& [x, y] : Pairs) {
84+ // CHECK-FIXES: for (const auto& [x, y] : Pairs) {
8585 const int & x = P.first ;
8686 const int & y = P.second ;
8787 }
8888
8989 std::pair<TestClass, TestClass> ClassPairs[10 ];
9090 for (auto P : ClassPairs) {
9191 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
92- // CHECK-FIXES: {{^}} for (auto [c1, c2] : ClassPairs) {
92+ // CHECK-FIXES: for (auto [c1, c2] : ClassPairs) {
9393 TestClass c1 = P.first ;
9494 TestClass c2 = P.second ;
9595 }
9696
9797 for (const auto P : ClassPairs) {
9898 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
99- // CHECK-FIXES: {{^}} for (const auto [c1, c2] : ClassPairs) {
99+ // CHECK-FIXES: for (const auto [c1, c2] : ClassPairs) {
100100 const TestClass c1 = P.first ;
101101 const TestClass c2 = P.second ;
102102 }
@@ -136,19 +136,19 @@ void stdTieWarnCases() {
136136 int b = 0 ;
137137 std::tie (a, b) = getPair<int , int >();
138138 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
139- // CHECK-FIXES: {{^}} auto [a, b] = getPair<int, int>();
139+ // CHECK-FIXES: auto [a, b] = getPair<int, int>();
140140
141141 int * pa = nullptr ;
142142 int * pb = nullptr ;
143143 std::tie (pa, pb) = getPair<int *, int *>();
144144 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
145- // CHECK-FIXES: {{^}} auto [pa, pb] = getPair<int*, int*>();
145+ // CHECK-FIXES: auto [pa, pb] = getPair<int*, int*>();
146146
147147 TestClass c1 (1 , 2 );
148148 TestClass c2 = TestClass {3 , 4 };
149149 std::tie (c1, c2) = getPair<TestClass, TestClass>();
150150 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use structured binding to decompose a pair [modernize-use-structured-binding]
151- // CHECK-FIXES: {{^}} auto [c1, c2] = getPair<TestClass, TestClass>();
151+ // CHECK-FIXES: auto [c1, c2] = getPair<TestClass, TestClass>();
152152}
153153
154154void stdTieNotWarnCases () {
0 commit comments