@@ -91,16 +91,6 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss,
9191 // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with
9292 // CHECK-FIXES: !s.starts_with("a");
9393
94- #define STR (x ) std::string(x)
95- 0 == STR (s).find (" a" );
96- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with
97- // CHECK-FIXES: STR(s).starts_with("a");
98-
99- #define STRING s
100- if (0 == STRING.find (" ala" )) { /* do something */ }
101- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with
102- // CHECK-FIXES: if (STRING.starts_with("ala"))
103-
10494 #define FIND find
10595 s.FIND (" a" ) == 0 ;
10696 // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with
@@ -265,6 +255,12 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss,
265255
266256 s.compare (0 , 1 , " ab" ) == 0 ;
267257 s.rfind (suffix, 1 ) == s.size () - suffix.size ();
258+
259+ #define STR (x ) std::string(x)
260+ 0 == STR (s).find (" a" );
261+
262+ #define STRING s
263+ if (0 == STRING.find (" ala" )) { /* do something */ }
268264}
269265
270266void test_substr () {
@@ -311,8 +307,5 @@ void test_substr() {
311307
312308 #define STR () str
313309 SUBSTR (STR (), 0 , 6 ) == " prefix" ;
314-
315310 " prefix" == SUBSTR (STR (), 0 , 6 );
316- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() == [modernize-use-starts-ends-with]
317-
318311}
0 commit comments