[PATCH] D149280: [clang-tidy] Add modernize-printf-to-std-print check
Mike Crowe via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 24 07:03:34 PDT 2023
mikecrowe marked 7 inline comments as done.
mikecrowe added a comment.
I'm still working on the remaining items.
================
Comment at: clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp:230
+ return conversionNotPossible("'%m' is not supported in format string");
+ } else {
+ StandardFormatString.push_back('{');
----------------
mikecrowe wrote:
> PiotrZSL wrote:
> > general: no need for else after return
> In general, you're correct that I've used else after return in other places and I will fix them. However, in this case the else is required since the very first `if` block above doesn't have a return. (Hopefully this complexity will go away if I succeed in splitting this function up.)
I've now reworked this function extensively, so there's no longer an else here.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst:117
+
+.. option:: PrintFunction
+
----------------
PiotrZSL wrote:
> mikecrowe wrote:
> > Is `PrintFunction` (and the soon-to-arrive `PrintlnFunction`) distinct enough from `PrintfLikeFunctions` and `FprintfLikeFunctions`? Should I use `ReplacementPrintFunction` instead?
> Use `Replacement`. It will be way better.
I assume that you mean `ReplacementPrintFunction`. (I see `ReplacementString` used in other checks, so I think that just `Replacement` might be a bit vague.)
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