[PATCH] D149280: [clang-tidy] Add modernize-printf-to-std-print check

Mike Crowe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 30 07:49:25 PDT 2023


mikecrowe marked an inline comment as done.
mikecrowe added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/printf-to-std-print-convert.cpp:289
+  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: Replace 'printf' with 'std::print' [modernize-printf-to-std-print]
+  // CHECK-FIXES: std::print("Integer {} from signed char\n", sc);
+
----------------
This requires a cast to `unsigned char`. It appears that `Arg->getType()->isSignedIntegerType()` inside the `uArg` case is returning `false` for `signed char`, which means that it doesn't get one. Strange!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149280/new/

https://reviews.llvm.org/D149280



More information about the cfe-commits mailing list