clang-tools 22.0.0git
clang::tidy::cppcoreguidelines::AvoidDoWhileCheck Class Reference

do-while loops are less readable than plan while loops, and can lead to subtle bugs. More...

#include <AvoidDoWhileCheck.h>

Inheritance diagram for clang::tidy::cppcoreguidelines::AvoidDoWhileCheck:
[legend]

Public Member Functions

 AvoidDoWhileCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

do-while loops are less readable than plan while loops, and can lead to subtle bugs.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-do-while.html

Definition at line 21 of file AvoidDoWhileCheck.h.

Constructor & Destructor Documentation

◆ AvoidDoWhileCheck()

clang::tidy::cppcoreguidelines::AvoidDoWhileCheck::AvoidDoWhileCheck ( StringRef Name,
ClangTidyContext * Context )

Definition at line 16 of file AvoidDoWhileCheck.cpp.

Member Function Documentation

◆ check()

void clang::tidy::cppcoreguidelines::AvoidDoWhileCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 28 of file AvoidDoWhileCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::cppcoreguidelines::AvoidDoWhileCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 24 of file AvoidDoWhileCheck.h.

◆ registerMatchers()

void clang::tidy::cppcoreguidelines::AvoidDoWhileCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 24 of file AvoidDoWhileCheck.cpp.

◆ storeOptions()

void clang::tidy::cppcoreguidelines::AvoidDoWhileCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 20 of file AvoidDoWhileCheck.cpp.


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