[clang-tools-extra] [clang-tidy] Add fix-it for C-style cast of nullptr (PR #173159)

via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 27 02:50:56 PST 2025


================
@@ -369,11 +369,11 @@ void functional_casts() {
   throw S2(5.0f);
 }
 void f(int *);
-void f(double *);
 
+void f(double *);
 void test_nullptr_cast() {
   f((int*)nullptr);
 }
-// CHECK-MESSAGES: warning: C-style casts are discouraged
+// CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: C-style casts are discouraged [modernize-avoid-c-style-cast]
----------------
zeyi2 wrote:

Please use exact numbers instead of regex :)

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


More information about the cfe-commits mailing list