clang-tools 22.0.0git
clang::tidy::cert::FloatLoopCounter Class Reference

This check diagnoses when the loop induction expression of a for loop has floating-point type. More...

#include <FloatLoopCounter.h>

Inheritance diagram for clang::tidy::cert::FloatLoopCounter:
[legend]

Public Member Functions

 FloatLoopCounter (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

This check diagnoses when the loop induction expression of a for loop has floating-point type.

The check corresponds to: https://www.securecoding.cert.org/confluence/display/c/FLP30-C.+Do+not+use+floating-point+variables+as+loop+counters

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cert/flp30-c.html

Definition at line 22 of file FloatLoopCounter.h.

Constructor & Destructor Documentation

◆ FloatLoopCounter()

clang::tidy::cert::FloatLoopCounter::FloatLoopCounter ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 24 of file FloatLoopCounter.h.

Member Function Documentation

◆ check()

void clang::tidy::cert::FloatLoopCounter::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 32 of file FloatLoopCounter.cpp.

◆ registerMatchers()

void clang::tidy::cert::FloatLoopCounter::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 18 of file FloatLoopCounter.cpp.


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