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

Finds cases where an integer is added to or subracted from the result of a memory allocation function instead of its argument. More...

#include <MisplacedPointerArithmeticInAllocCheck.h>

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

Public Member Functions

 MisplacedPointerArithmeticInAllocCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

Finds cases where an integer is added to or subracted from the result of a memory allocation function instead of its argument.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-pointer-arithmetic-in-alloc.html

Definition at line 21 of file MisplacedPointerArithmeticInAllocCheck.h.

Constructor & Destructor Documentation

◆ MisplacedPointerArithmeticInAllocCheck()

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

Definition at line 23 of file MisplacedPointerArithmeticInAllocCheck.h.

Member Function Documentation

◆ check()

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

Definition at line 60 of file MisplacedPointerArithmeticInAllocCheck.cpp.

◆ registerMatchers()

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

Definition at line 18 of file MisplacedPointerArithmeticInAllocCheck.cpp.


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