clang-tools 22.0.0git
|
This check finds cases where Duration factories are being called with floating point arguments, but could be called using integer arguments. More...
#include <DurationFactoryFloatCheck.h>
Public Member Functions | |
DurationFactoryFloatCheck (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 |
This check finds cases where Duration factories are being called with floating point arguments, but could be called using integer arguments.
It handles explicit casts and floating point literals with no fractional component.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-factory-float.html
Definition at line 23 of file DurationFactoryFloatCheck.h.
|
inline |
Definition at line 25 of file DurationFactoryFloatCheck.h.
|
override |
Definition at line 43 of file DurationFactoryFloatCheck.cpp.
References clang::tidy::abseil::insideMacroDefinition(), clang::tidy::abseil::stripFloatCast(), and clang::tidy::abseil::stripFloatLiteralFraction().
|
inlineoverride |
Definition at line 27 of file DurationFactoryFloatCheck.h.
|
override |
Definition at line 29 of file DurationFactoryFloatCheck.cpp.