[PATCH] D143342: [clang-tidy] Support std::format and std::print in readability-redundant-string-cstr

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 10 02:06:33 PST 2023


PiotrZSL added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp:189
+                              getLangOpts().CPlusPlus2b
+                                  ? hasAnyName("::std::print", "::std::format")
+                                  : hasName("::std::format"))),
----------------
Please introduce configuration option to specify custom functions.
For example if some project (like mine) is wrapping fmt::format with some variadic template function, then such function could be specified.
Same goes to things like some loggers.

Check utils/OptionsUtils.h for configuration, and  utils/Matchers.h (matchesAnyListedName)


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

https://reviews.llvm.org/D143342



More information about the cfe-commits mailing list