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

Checks for classes where some, but not all, of the special member functions are defined. More...

#include <SpecialMemberFunctionsCheck.h>

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

Classes

struct  SpecialMemberFunctionData

Public Types

enum class  SpecialMemberFunctionKind : uint8_t {
  Destructor , DefaultDestructor , NonDefaultDestructor , CopyConstructor ,
  CopyAssignment , MoveConstructor , MoveAssignment
}
using ClassDefId = std::pair<SourceLocation, std::string>
using ClassDefiningSpecialMembersMap

Public Member Functions

 SpecialMemberFunctionsCheck (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
void onEndOfTranslationUnit () override
std::optional< TraversalKind > getCheckTraversalKind () const override

Detailed Description

Checks for classes where some, but not all, of the special member functions are defined.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/special-member-functions.html

Definition at line 23 of file SpecialMemberFunctionsCheck.h.

Member Typedef Documentation

◆ ClassDefId

using clang::tidy::cppcoreguidelines::SpecialMemberFunctionsCheck::ClassDefId = std::pair<SourceLocation, std::string>

Definition at line 56 of file SpecialMemberFunctionsCheck.h.

◆ ClassDefiningSpecialMembersMap

Initial value:
llvm::DenseMap<ClassDefId,
llvm::SmallVector<SpecialMemberFunctionData, 5>>

Definition at line 58 of file SpecialMemberFunctionsCheck.h.

Member Enumeration Documentation

◆ SpecialMemberFunctionKind

Enumerator
Destructor 
DefaultDestructor 
NonDefaultDestructor 
CopyConstructor 
CopyAssignment 
MoveConstructor 
MoveAssignment 

Definition at line 35 of file SpecialMemberFunctionsCheck.h.

Constructor & Destructor Documentation

◆ SpecialMemberFunctionsCheck()

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

Definition at line 27 of file SpecialMemberFunctionsCheck.cpp.

Member Function Documentation

◆ check()

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

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::cppcoreguidelines::SpecialMemberFunctionsCheck::getCheckTraversalKind ( ) const
override

Definition at line 50 of file SpecialMemberFunctionsCheck.cpp.

◆ isLanguageVersionSupported()

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

Definition at line 26 of file SpecialMemberFunctionsCheck.h.

◆ onEndOfTranslationUnit()

void clang::tidy::cppcoreguidelines::SpecialMemberFunctionsCheck::onEndOfTranslationUnit ( )
override

Definition at line 163 of file SpecialMemberFunctionsCheck.cpp.

◆ registerMatchers()

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

Definition at line 55 of file SpecialMemberFunctionsCheck.cpp.

◆ storeOptions()

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

Definition at line 38 of file SpecialMemberFunctionsCheck.cpp.


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