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

Finds user-defined copy assignment operators which do not protect the code against self-assignment either by checking self-assignment explicitly or using the copy-and-swap or the copy-and-move method. More...

#include <UnhandledSelfAssignmentCheck.h>

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

Public Member Functions

 UnhandledSelfAssignmentCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

Finds user-defined copy assignment operators which do not protect the code against self-assignment either by checking self-assignment explicitly or using the copy-and-swap or the copy-and-move method.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/unhandled-self-assignment.html

Definition at line 22 of file UnhandledSelfAssignmentCheck.h.

Constructor & Destructor Documentation

◆ UnhandledSelfAssignmentCheck()

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

Definition at line 17 of file UnhandledSelfAssignmentCheck.cpp.

Member Function Documentation

◆ check()

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

Definition at line 124 of file UnhandledSelfAssignmentCheck.cpp.

◆ isLanguageVersionSupported()

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

Definition at line 26 of file UnhandledSelfAssignmentCheck.h.

◆ registerMatchers()

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

Definition at line 29 of file UnhandledSelfAssignmentCheck.cpp.

◆ storeOptions()

void clang::tidy::bugprone::UnhandledSelfAssignmentCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 23 of file UnhandledSelfAssignmentCheck.cpp.


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