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

Flags all kinds of pointer arithmetic that have result of pointer type, i.e. More...

#include <ProBoundsPointerArithmeticCheck.h>

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

Public Member Functions

 ProBoundsPointerArithmeticCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const 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

Flags all kinds of pointer arithmetic that have result of pointer type, i.e.

+, -, +=, -=, ++, –. In addition, the [] operator on pointers (not on arrays) is flagged.

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

Definition at line 22 of file ProBoundsPointerArithmeticCheck.h.

Constructor & Destructor Documentation

◆ ProBoundsPointerArithmeticCheck()

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

Definition at line 17 of file ProBoundsPointerArithmeticCheck.cpp.

Member Function Documentation

◆ check()

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

Definition at line 65 of file ProBoundsPointerArithmeticCheck.cpp.

◆ isLanguageVersionSupported()

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

Definition at line 25 of file ProBoundsPointerArithmeticCheck.h.

◆ registerMatchers()

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

Definition at line 29 of file ProBoundsPointerArithmeticCheck.cpp.

◆ storeOptions()

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

Definition at line 23 of file ProBoundsPointerArithmeticCheck.cpp.


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