clang-tools 24.0.0git
clang::tidy::utils::type_traits Namespace Reference

Functions

static bool classHasTrivialCopyAndDestroy (QualType Type)
static bool hasDeletedCopyConstructor (QualType Type)
std::optional< bool > isExpensiveToCopy (QualType Type, const ASTContext &Context)
 Returns true if Type is expensive to copy.
bool recordIsTriviallyDefaultConstructible (const RecordDecl &RecordDecl, const ASTContext &Context)
 Returns true if RecordDecl is trivially default constructible.
bool isTriviallyDefaultConstructible (QualType Type, const ASTContext &Context)
 Returns true if Type is trivially default constructible.
bool isTriviallyDestructible (QualType Type)
 Returns true if Type is trivially destructible.
bool hasNonTrivialMoveConstructor (QualType Type)
 Returns true if Type has a non-trivial move constructor.
bool hasNonTrivialMoveAssignment (QualType Type)
 Return true if Type has a non-trivial move assignment operator.
static bool declIsStdInitializerList (const NamedDecl *D)
bool isStdInitializerList (QualType Type)
 Returns true if Type is a std::initializer_list<...> specialization.

Function Documentation

◆ classHasTrivialCopyAndDestroy()

bool clang::tidy::utils::type_traits::classHasTrivialCopyAndDestroy ( QualType Type)
static

Definition at line 17 of file TypeTraits.cpp.

Referenced by isExpensiveToCopy().

◆ declIsStdInitializerList()

bool clang::tidy::utils::type_traits::declIsStdInitializerList ( const NamedDecl * D)
static

Definition at line 150 of file TypeTraits.cpp.

Referenced by isStdInitializerList().

◆ hasDeletedCopyConstructor()

bool clang::tidy::utils::type_traits::hasDeletedCopyConstructor ( QualType Type)
static

Definition at line 24 of file TypeTraits.cpp.

Referenced by isExpensiveToCopy().

◆ hasNonTrivialMoveAssignment()

bool clang::tidy::utils::type_traits::hasNonTrivialMoveAssignment ( QualType Type)

Return true if Type has a non-trivial move assignment operator.

Definition at line 144 of file TypeTraits.cpp.

Referenced by clang::tidy::performance::UnnecessaryValueParamCheck::check().

◆ hasNonTrivialMoveConstructor()

bool clang::tidy::utils::type_traits::hasNonTrivialMoveConstructor ( QualType Type)

Returns true if Type has a non-trivial move constructor.

Definition at line 138 of file TypeTraits.cpp.

Referenced by clang::tidy::performance::UnnecessaryValueParamCheck::check().

◆ isExpensiveToCopy()

std::optional< bool > clang::tidy::utils::type_traits::isExpensiveToCopy ( QualType Type,
const ASTContext & Context )

Returns true if Type is expensive to copy.

Definition at line 33 of file TypeTraits.cpp.

References classHasTrivialCopyAndDestroy(), and hasDeletedCopyConstructor().

Referenced by clang::tidy::matchers::AST_MATCHER().

◆ isStdInitializerList()

bool clang::tidy::utils::type_traits::isStdInitializerList ( QualType Type)

Returns true if Type is a std::initializer_list<...> specialization.

Definition at line 154 of file TypeTraits.cpp.

References declIsStdInitializerList().

Referenced by clang::tidy::misc::ExplicitConstructorCheck::check(), and clang::tidy::modernize::hasInitListConstructor().

◆ isTriviallyDefaultConstructible()

bool clang::tidy::utils::type_traits::isTriviallyDefaultConstructible ( QualType Type,
const ASTContext & Context )

◆ isTriviallyDestructible()

bool clang::tidy::utils::type_traits::isTriviallyDestructible ( QualType Type)

Returns true if Type is trivially destructible.

Definition at line 125 of file TypeTraits.cpp.

Referenced by clang::tidy::matchers::AST_MATCHER().

◆ recordIsTriviallyDefaultConstructible()

bool clang::tidy::utils::type_traits::recordIsTriviallyDefaultConstructible ( const RecordDecl & RecordDecl,
const ASTContext & Context )

Returns true if RecordDecl is trivially default constructible.

Definition at line 42 of file TypeTraits.cpp.

References isTriviallyDefaultConstructible().

Referenced by clang::tidy::matchers::AST_MATCHER(), and isTriviallyDefaultConstructible().