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

Find usages of sizeof on expressions of STL container types. More...

#include <SizeofContainerCheck.h>

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

Public Member Functions

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

Find usages of sizeof on expressions of STL container types.

Most likely the user wanted to use .size() instead.

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

Definition at line 21 of file SizeofContainerCheck.h.

Constructor & Destructor Documentation

◆ SizeofContainerCheck()

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

Definition at line 23 of file SizeofContainerCheck.h.

Member Function Documentation

◆ check()

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

Definition at line 34 of file SizeofContainerCheck.cpp.

◆ isLanguageVersionSupported()

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

Definition at line 25 of file SizeofContainerCheck.h.

◆ registerMatchers()

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

Definition at line 16 of file SizeofContainerCheck.cpp.


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