clang-tools 22.0.0git
|
Converts calls to absl::StrFormat, or other functions via configuration options, to C++20's std::format, or another function via a configuration option, modifying the format string appropriately and removing now-unnecessary calls to std::string::c_str() and std::string::data(). More...
#include <UseStdFormatCheck.h>
Public Member Functions | |
UseStdFormatCheck (StringRef Name, ClangTidyContext *Context) | |
bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
void | registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override |
void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
std::optional< TraversalKind > | getCheckTraversalKind () const override |
Converts calls to absl::StrFormat, or other functions via configuration options, to C++20's std::format, or another function via a configuration option, modifying the format string appropriately and removing now-unnecessary calls to std::string::c_str() and std::string::data().
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-std-format.html
Definition at line 24 of file UseStdFormatCheck.h.
clang::tidy::modernize::UseStdFormatCheck::UseStdFormatCheck | ( | StringRef | Name, |
ClangTidyContext * | Context ) |
Definition at line 24 of file UseStdFormatCheck.cpp.
|
override |
Definition at line 71 of file UseStdFormatCheck.cpp.
References clang::tidy::utils::FormatStringConverter::applyFixes(), clang::tidy::utils::FormatStringConverter::canApply(), clang::tidy::utils::FormatStringConverter::conversionNotPossibleReason(), and clang::tidy::utils::FormatStringConverter::Configuration::StrictMode.
|
inlineoverride |
Definition at line 37 of file UseStdFormatCheck.h.
|
inlineoverride |
Definition at line 27 of file UseStdFormatCheck.h.
|
override |
Definition at line 49 of file UseStdFormatCheck.cpp.
References clang::tidy::matchers::matchesAnyListedName().
|
override |
Definition at line 42 of file UseStdFormatCheck.cpp.
|
override |
Definition at line 60 of file UseStdFormatCheck.cpp.
References clang::tidy::utils::options::serializeStringList().