[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 08:03:18 PDT 2023


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);
+
----------------
mikecrowe wrote:
> 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!
> 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!

Operator error. Apologies for the noise. :(


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