clang-tools 22.0.0git
|
Finds constants and function calls to math functions that can be replaced with c++20's mathematical constants from the numbers header and offers fix-it hints. More...
#include <UseStdNumbersCheck.h>
Public Member Functions | |
UseStdNumbersCheck (StringRef Name, ClangTidyContext *Context) | |
bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
void | registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override |
void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
std::optional< TraversalKind > | getCheckTraversalKind () const override |
Finds constants and function calls to math functions that can be replaced with c++20's mathematical constants from the numbers header and offers fix-it hints.
Does not match the use of variables with that value, and instead, offers a replacement at the definition of those variables.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-std-numbers.html
Definition at line 25 of file UseStdNumbersCheck.h.
clang::tidy::modernize::UseStdNumbersCheck::UseStdNumbersCheck | ( | StringRef | Name, |
ClangTidyContext * | Context ) |
Definition at line 293 of file UseStdNumbersCheck.cpp.
|
override |
Definition at line 331 of file UseStdNumbersCheck.cpp.
References getCode(), and isRangeOfCompleteMacro().
|
inlineoverride |
Definition at line 37 of file UseStdNumbersCheck.h.
|
inlineoverride |
Definition at line 29 of file UseStdNumbersCheck.h.
|
override |
Definition at line 308 of file UseStdNumbersCheck.cpp.
|
override |
Definition at line 440 of file UseStdNumbersCheck.cpp.
|
override |
Definition at line 446 of file UseStdNumbersCheck.cpp.