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

Checks for ignored calls to empty() on a range and suggests clear() as an alternative if it is an existing member function. More...

#include <StandaloneEmptyCheck.h>

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

Public Member Functions

 StandaloneEmptyCheck (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

Checks for ignored calls to empty() on a range and suggests clear() as an alternative if it is an existing member function.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/standalone-empty.html

Definition at line 21 of file StandaloneEmptyCheck.h.

Constructor & Destructor Documentation

◆ StandaloneEmptyCheck()

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

Definition at line 23 of file StandaloneEmptyCheck.h.

Member Function Documentation

◆ check()

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

Definition at line 96 of file StandaloneEmptyCheck.cpp.

References clang::tidy::bugprone::getCondition().

◆ isLanguageVersionSupported()

bool clang::tidy::bugprone::StandaloneEmptyCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 25 of file StandaloneEmptyCheck.h.

◆ registerMatchers()

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

Definition at line 74 of file StandaloneEmptyCheck.cpp.


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