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

This checks that all array subscriptions on static arrays and std::arrays have a constant index and are within bounds. More...

#include <ProBoundsConstantArrayIndexCheck.h>

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

Public Member Functions

 ProBoundsConstantArrayIndexCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

This checks that all array subscriptions on static arrays and std::arrays have a constant index and are within bounds.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index.html

Definition at line 22 of file ProBoundsConstantArrayIndexCheck.h.

Constructor & Destructor Documentation

◆ ProBoundsConstantArrayIndexCheck()

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

Definition at line 20 of file ProBoundsConstantArrayIndexCheck.cpp.

Member Function Documentation

◆ check()

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

◆ isLanguageVersionSupported()

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

Definition at line 28 of file ProBoundsConstantArrayIndexCheck.h.

◆ registerMatchers()

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

Definition at line 38 of file ProBoundsConstantArrayIndexCheck.cpp.

◆ registerPPCallbacks()

void clang::tidy::cppcoreguidelines::ProBoundsConstantArrayIndexCheck::registerPPCallbacks ( const SourceManager & SM,
Preprocessor * PP,
Preprocessor * ModuleExpanderPP )
override

Definition at line 33 of file ProBoundsConstantArrayIndexCheck.cpp.

◆ storeOptions()

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

Definition at line 27 of file ProBoundsConstantArrayIndexCheck.cpp.


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