clang-tools 22.0.0git
clang::tidy::bugprone::FloatLoopCounterCheck Class Reference

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

#include <FloatLoopCounterCheck.h>

Inheritance diagram for clang::tidy::bugprone::FloatLoopCounterCheck:
[legend]

Public Member Functions

 FloatLoopCounterCheck (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/bugprone/float-loop-counter.html

Definition at line 22 of file FloatLoopCounterCheck.h.

Constructor & Destructor Documentation

◆ FloatLoopCounterCheck()

clang::tidy::bugprone::FloatLoopCounterCheck::FloatLoopCounterCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 24 of file FloatLoopCounterCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::bugprone::FloatLoopCounterCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 32 of file FloatLoopCounterCheck.cpp.

◆ registerMatchers()

void clang::tidy::bugprone::FloatLoopCounterCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 18 of file FloatLoopCounterCheck.cpp.


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