clang-tools 22.0.0git
clang::tidy::abseil::DurationFactoryFloatCheck Class Reference

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>

Inheritance diagram for clang::tidy::abseil::DurationFactoryFloatCheck:
[legend]

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ DurationFactoryFloatCheck()

clang::tidy::abseil::DurationFactoryFloatCheck::DurationFactoryFloatCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 25 of file DurationFactoryFloatCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::abseil::DurationFactoryFloatCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ isLanguageVersionSupported()

bool clang::tidy::abseil::DurationFactoryFloatCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 27 of file DurationFactoryFloatCheck.h.

◆ registerMatchers()

void clang::tidy::abseil::DurationFactoryFloatCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 29 of file DurationFactoryFloatCheck.cpp.


The documentation for this class was generated from the following files: