[clang-tools-extra] [clang-tidy] Speed up/rewrite `bugprone-stringview-nullptr` (PR #192889)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 19 21:33:06 PDT 2026


================
@@ -1061,47 +1061,47 @@ void function_argument_initialization() /* f */ {
   // Function Argument Initialization
   {
     function(nullptr) /* f1 */;
-    // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: passing null as basic_string_view is undefined; replace with the empty string
+    // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: constructing
     // CHECK-FIXES: function("") /* f1 */;
 
     function((nullptr)) /* f2 */;
-    // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: passing{{.*}}empty string
+    // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: constructing
     // CHECK-FIXES: function("") /* f2 */;
 
     function({nullptr}) /* f3 */;
-    // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: passing{{.*}}empty string
-    // CHECK-FIXES: function("") /* f3 */;
+    // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: constructing
+    // CHECK-FIXES: function({}) /* f3 */;
----------------
localspook wrote:

First nontrivial change

https://github.com/llvm/llvm-project/pull/192889


More information about the cfe-commits mailing list