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

Flags calls to operator[] in STL containers and suggests replacing it with safe alternatives. More...

#include <ProBoundsAvoidUncheckedContainerAccess.h>

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

Public Types

enum  FixModes { None , At , Function }

Public Member Functions

 ProBoundsAvoidUncheckedContainerAccess (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
void storeOptions (ClangTidyOptions::OptionMap &Opts) override

Detailed Description

Flags calls to operator[] in STL containers and suggests replacing it with safe alternatives.

See https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#slcon3-avoid-bounds-errors For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.html

Definition at line 23 of file ProBoundsAvoidUncheckedContainerAccess.h.

Member Enumeration Documentation

◆ FixModes

Constructor & Destructor Documentation

◆ ProBoundsAvoidUncheckedContainerAccess()

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

Member Function Documentation

◆ check()

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

◆ isLanguageVersionSupported()

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

Definition at line 27 of file ProBoundsAvoidUncheckedContainerAccess.h.

◆ registerMatchers()

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

◆ storeOptions()

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

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