clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
clang::CXXRecordDecl Class Reference

Represents a C++ struct/union/class. More...

#include <DeclCXX.h>

Inheritance diagram for clang::CXXRecordDecl:
Inheritance graph
[legend]
Collaboration diagram for clang::CXXRecordDecl:
Collaboration graph
[legend]

List of all members.

Classes

struct  DefinitionData
class  friend_iterator
 An iterator over the friend declarations of a class. More...
struct  LambdaDefinitionData
 Describes a C++ closure type (generated by a lambda expression).

Public Types

typedef CXXBaseSpecifierbase_class_iterator
 Iterator that traverses the base classes of a class.
typedef const CXXBaseSpecifierbase_class_const_iterator
 Iterator that traverses the base classes of a class.
typedef llvm::iterator_range
< base_class_iterator
base_class_range
typedef llvm::iterator_range
< base_class_const_iterator
base_class_const_range
typedef specific_decl_iterator
< CXXMethodDecl
method_iterator
typedef llvm::iterator_range
< specific_decl_iterator
< CXXMethodDecl > > 
method_range
typedef specific_decl_iterator
< CXXConstructorDecl
ctor_iterator
 Iterator access to constructor members.
typedef llvm::iterator_range
< specific_decl_iterator
< CXXConstructorDecl > > 
ctor_range
typedef llvm::iterator_range
< friend_iterator
friend_range
typedef const LambdaCapturecapture_const_iterator
typedef llvm::iterator_range
< capture_const_iterator
capture_const_range
typedef UnresolvedSetIterator conversion_iterator
typedef bool ForallBasesCallback (const CXXRecordDecl *BaseDefinition, void *UserData)
 Function type used by forallBases() as a callback.
typedef bool BaseMatchesCallback (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)
 Function type used by lookupInBases() to determine whether a specific base class subobject matches the lookup criteria.

Public Member Functions

CXXRecordDeclgetCanonicalDecl () override
 Retrieves the "canonical" declaration of the given declaration.
virtual const CXXRecordDeclgetCanonicalDecl () const
CXXRecordDeclgetPreviousDecl ()
 Return the previous declaration of this declaration or NULL if this is the first declaration.
const CXXRecordDeclgetPreviousDecl () const
CXXRecordDeclgetMostRecentDecl ()
 Returns the most recent (re)declaration of this declaration.
const CXXRecordDeclgetMostRecentDecl () const
 Returns the most recent (re)declaration of this declaration.
CXXRecordDeclgetDefinition () const
bool hasDefinition () const
bool isDynamicClass () const
void setIsParsingBaseSpecifiers ()
bool isParsingBaseSpecifiers () const
void setBases (CXXBaseSpecifier const *const *Bases, unsigned NumBases)
 Sets the base classes of this struct or class.
unsigned getNumBases () const
 Retrieves the number of base classes of this class.
base_class_range bases ()
base_class_const_range bases () const
base_class_iterator bases_begin ()
base_class_const_iterator bases_begin () const
base_class_iterator bases_end ()
base_class_const_iterator bases_end () const
unsigned getNumVBases () const
 Retrieves the number of virtual base classes of this class.
base_class_range vbases ()
base_class_const_range vbases () const
base_class_iterator vbases_begin ()
base_class_const_iterator vbases_begin () const
base_class_iterator vbases_end ()
base_class_const_iterator vbases_end () const
bool hasAnyDependentBases () const
 Determine whether this class has any dependent base classes which are not the current instantiation.
method_range methods () const
method_iterator method_begin () const
 Method begin iterator. Iterates in the order the methods were declared.
method_iterator method_end () const
 Method past-the-end iterator.
ctor_range ctors () const
ctor_iterator ctor_begin () const
ctor_iterator ctor_end () const
friend_range friends () const
friend_iterator friend_begin () const
friend_iterator friend_end () const
void pushFriendDecl (FriendDecl *FD)
bool hasFriends () const
 Determines whether this record has any friends.
bool hasSimpleMoveConstructor () const
 true if we know for sure that this class has a single, accessible, unambiguous move constructor that is not deleted.
bool hasSimpleMoveAssignment () const
 true if we know for sure that this class has a single, accessible, unambiguous move assignment operator that is not deleted.
bool hasSimpleDestructor () const
 true if we know for sure that this class has an accessible destructor that is not deleted.
bool hasDefaultConstructor () const
 Determine whether this class has any default constructors.
bool needsImplicitDefaultConstructor () const
 Determine if we need to declare a default constructor for this class.
bool hasUserDeclaredConstructor () const
 Determine whether this class has any user-declared constructors.
bool hasUserProvidedDefaultConstructor () const
 Whether this class has a user-provided default constructor per C++11.
bool hasUserDeclaredCopyConstructor () const
 Determine whether this class has a user-declared copy constructor.
bool needsImplicitCopyConstructor () const
 Determine whether this class needs an implicit copy constructor to be lazily declared.
bool needsOverloadResolutionForCopyConstructor () const
 Determine whether we need to eagerly declare a defaulted copy constructor for this class.
bool implicitCopyConstructorHasConstParam () const
 Determine whether an implicit copy constructor for this type would have a parameter with a const-qualified reference type.
bool hasCopyConstructorWithConstParam () const
 Determine whether this class has a copy constructor with a parameter type which is a reference to a const-qualified type.
bool hasUserDeclaredMoveOperation () const
 Whether this class has a user-declared move constructor or assignment operator.
bool hasUserDeclaredMoveConstructor () const
 Determine whether this class has had a move constructor declared by the user.
bool hasMoveConstructor () const
 Determine whether this class has a move constructor.
void setImplicitMoveConstructorIsDeleted ()
 Set that we attempted to declare an implicitly move constructor, but overload resolution failed so we deleted it.
bool needsImplicitMoveConstructor () const
 Determine whether this class should get an implicit move constructor or if any existing special member function inhibits this.
bool needsOverloadResolutionForMoveConstructor () const
 Determine whether we need to eagerly declare a defaulted move constructor for this class.
bool hasUserDeclaredCopyAssignment () const
 Determine whether this class has a user-declared copy assignment operator.
bool needsImplicitCopyAssignment () const
 Determine whether this class needs an implicit copy assignment operator to be lazily declared.
bool needsOverloadResolutionForCopyAssignment () const
 Determine whether we need to eagerly declare a defaulted copy assignment operator for this class.
bool implicitCopyAssignmentHasConstParam () const
 Determine whether an implicit copy assignment operator for this type would have a parameter with a const-qualified reference type.
bool hasCopyAssignmentWithConstParam () const
 Determine whether this class has a copy assignment operator with a parameter type which is a reference to a const-qualified type or is not a reference.
bool hasUserDeclaredMoveAssignment () const
 Determine whether this class has had a move assignment declared by the user.
bool hasMoveAssignment () const
 Determine whether this class has a move assignment operator.
void setImplicitMoveAssignmentIsDeleted ()
 Set that we attempted to declare an implicit move assignment operator, but overload resolution failed so we deleted it.
bool needsImplicitMoveAssignment () const
 Determine whether this class should get an implicit move assignment operator or if any existing special member function inhibits this.
bool needsOverloadResolutionForMoveAssignment () const
 Determine whether we need to eagerly declare a move assignment operator for this class.
bool hasUserDeclaredDestructor () const
 Determine whether this class has a user-declared destructor.
bool needsImplicitDestructor () const
 Determine whether this class needs an implicit destructor to be lazily declared.
bool needsOverloadResolutionForDestructor () const
 Determine whether we need to eagerly declare a destructor for this class.
bool isLambda () const
 Determine whether this class describes a lambda function object.
bool isGenericLambda () const
 Determine whether this class describes a generic lambda function object (i.e. function call operator is a template).
CXXMethodDeclgetLambdaCallOperator () const
 Retrieve the lambda call operator of the closure type if this is a closure type.
CXXMethodDeclgetLambdaStaticInvoker () const
 Retrieve the lambda static invoker, the address of which is returned by the conversion operator, and the body of which is forwarded to the lambda call operator.
TemplateParameterListgetGenericLambdaTemplateParameterList () const
 Retrieve the generic lambda's template parameter list. Returns null if the class does not represent a lambda or a generic lambda.
LambdaCaptureDefault getLambdaCaptureDefault () const
void getCaptureFields (llvm::DenseMap< const VarDecl *, FieldDecl * > &Captures, FieldDecl *&ThisCapture) const
 For a closure type, retrieve the mapping from captured variables and this to the non-static data members that store the values or references of the captures.
capture_const_range captures () const
capture_const_iterator captures_begin () const
capture_const_iterator captures_end () const
conversion_iterator conversion_begin () const
conversion_iterator conversion_end () const
void removeConversion (const NamedDecl *Old)
std::pair< conversion_iterator,
conversion_iterator
getVisibleConversionFunctions ()
 Get all conversion functions visible in current class, including conversion function templates.
bool isAggregate () const
bool hasInClassInitializer () const
 Whether this class has any in-class initializers for non-static data members (including those in anonymous unions or structs).
bool hasUninitializedReferenceMember () const
 Whether this class or any of its subobjects has any members of reference type which would make value-initialization ill-formed.
bool isPOD () const
 Whether this class is a POD-type (C++ [class]p4)
bool isCLike () const
 True if this class is C-like, without C++-specific features, e.g. it contains only public fields, no bases, tag kind is not 'class', etc.
bool isEmpty () const
 Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
bool isPolymorphic () const
bool isAbstract () const
 Determine whether this class has a pure virtual function.
bool isStandardLayout () const
 Determine whether this class has standard layout per (C++ [class]p7)
bool hasMutableFields () const
 Determine whether this class, or any of its class subobjects, contains a mutable field.
bool hasVariantMembers () const
 Determine whether this class has any variant members.
bool hasTrivialDefaultConstructor () const
 Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).
bool hasNonTrivialDefaultConstructor () const
 Determine whether this class has a non-trivial default constructor (C++11 [class.ctor]p5).
bool hasConstexprNonCopyMoveConstructor () const
 Determine whether this class has at least one constexpr constructor other than the copy or move constructors.
bool defaultedDefaultConstructorIsConstexpr () const
 Determine whether a defaulted default constructor for this class would be constexpr.
bool hasConstexprDefaultConstructor () const
 Determine whether this class has a constexpr default constructor.
bool hasTrivialCopyConstructor () const
 Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class.copy]p12)
bool hasNonTrivialCopyConstructor () const
 Determine whether this class has a non-trivial copy constructor (C++ [class.copy]p6, C++11 [class.copy]p12)
bool hasTrivialMoveConstructor () const
 Determine whether this class has a trivial move constructor (C++11 [class.copy]p12)
bool hasNonTrivialMoveConstructor () const
 Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12)
bool hasTrivialCopyAssignment () const
 Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool hasNonTrivialCopyAssignment () const
 Determine whether this class has a non-trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool hasTrivialMoveAssignment () const
 Determine whether this class has a trivial move assignment operator (C++11 [class.copy]p25)
bool hasNonTrivialMoveAssignment () const
 Determine whether this class has a non-trivial move assignment operator (C++11 [class.copy]p25)
bool hasTrivialDestructor () const
 Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
bool hasNonTrivialDestructor () const
 Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)
bool hasIrrelevantDestructor () const
 Determine whether this class has a destructor which has no semantic effect.
bool hasNonLiteralTypeFieldsOrBases () const
 Determine whether this class has a non-literal or/ volatile type non-static data member or base class.
bool isTriviallyCopyable () const
 Determine whether this class is considered trivially copyable per (C++11 [class]p6).
bool isTrivial () const
 Determine whether this class is considered trivial.
bool isLiteral () const
 Determine whether this class is a literal type.
CXXRecordDeclgetInstantiatedFromMemberClass () const
 If this record is an instantiation of a member class, retrieves the member class from which it was instantiated.
MemberSpecializationInfogetMemberSpecializationInfo () const
 If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
void setInstantiationOfMemberClass (CXXRecordDecl *RD, TemplateSpecializationKind TSK)
 Specify that this record is an instantiation of the member class RD.
ClassTemplateDeclgetDescribedClassTemplate () const
 Retrieves the class template that is described by this class declaration.
void setDescribedClassTemplate (ClassTemplateDecl *Template)
TemplateSpecializationKind getTemplateSpecializationKind () const
 Determine whether this particular class is a specialization or instantiation of a class template or member class of a class template, and how it was instantiated or specialized.
void setTemplateSpecializationKind (TemplateSpecializationKind TSK)
 Set the kind of specialization or template instantiation this is.
const CXXRecordDeclgetTemplateInstantiationPattern () const
 Retrieve the record declaration from which this record could be instantiated. Returns null if this class is not a template instantiation.
CXXRecordDeclgetTemplateInstantiationPattern ()
CXXDestructorDeclgetDestructor () const
 Returns the destructor decl for this class.
const FunctionDeclisLocalClass () const
 If the class is a local class [class.local], returns the enclosing function declaration.
FunctionDeclisLocalClass ()
bool isCurrentInstantiation (const DeclContext *CurContext) const
 Determine whether this dependent class is a current instantiation, when viewed from within the given context.
bool isDerivedFrom (const CXXRecordDecl *Base) const
 Determine whether this class is derived from the class Base.
bool isDerivedFrom (const CXXRecordDecl *Base, CXXBasePaths &Paths) const
 Determine whether this class is derived from the type Base.
bool isVirtuallyDerivedFrom (const CXXRecordDecl *Base) const
 Determine whether this class is virtually derived from the class Base.
bool isProvablyNotDerivedFrom (const CXXRecordDecl *Base) const
 Determine whether this class is provably not derived from the type Base.
bool forallBases (ForallBasesCallback *BaseMatches, void *UserData, bool AllowShortCircuit=true) const
 Determines if the given callback holds for all the direct or indirect base classes of this type.
bool lookupInBases (BaseMatchesCallback *BaseMatches, void *UserData, CXXBasePaths &Paths) const
 Look for entities within the base classes of this C++ class, transitively searching all base class subobjects.
void getFinalOverriders (CXXFinalOverriderMap &FinaOverriders) const
 Retrieve the final overriders for each virtual member function in the class hierarchy where this class is the most-derived class in the class hierarchy.
void getIndirectPrimaryBases (CXXIndirectPrimaryBaseSet &Bases) const
 Get the indirect primary bases for this class.
void viewInheritance (ASTContext &Context) const
void finishedDefaultedOrDeletedMember (CXXMethodDecl *MD)
 Indicates that the declaration of a defaulted or deleted special member function is now complete.
void completeDefinition () override
 Indicates that the definition of this class is now complete.
void completeDefinition (CXXFinalOverriderMap *FinalOverriders)
 Indicates that the definition of this class is now complete, and provides a final overrider map to help determine.
bool mayBeAbstract () const
 Determine whether this class may end up being abstract, even though it is not yet known to be abstract.
unsigned getLambdaManglingNumber () const
 If this is the closure type of a lambda expression, retrieve the number to be used for name mangling in the Itanium C++ ABI.
DeclgetLambdaContextDecl () const
 Retrieve the declaration that provides additional context for a lambda, when the normal declaration context is not specific enough.
void setLambdaMangling (unsigned ManglingNumber, Decl *ContextDecl)
 Set the mangling number and context declaration for a lambda class.
MSInheritanceAttr::Spelling getMSInheritanceModel () const
 Returns the inheritance model used for this record.
MSInheritanceAttr::Spelling calculateInheritanceModel () const
 Calculate what the inheritance model would be for this class.
bool nullFieldOffsetIsZero () const
MSVtorDispAttr::Mode getMSVtorDispMode () const
 Controls when vtordisps will be emitted if this record is used as a virtual base.
bool isDependentLambda () const
 Determine whether this lambda expression was known to be dependent at the time it was created, even if its context does not appear to be dependent.
TypeSourceInfogetLambdaTypeInfo () const

Static Public Member Functions

static CXXRecordDeclCreate (const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=nullptr, bool DelayTypeCreation=false)
static CXXRecordDeclCreateLambda (const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, bool DependentLambda, bool IsGeneric, LambdaCaptureDefault CaptureDefault)
static CXXRecordDeclCreateDeserialized (const ASTContext &C, unsigned ID)
static bool FindBaseClass (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *BaseRecord)
 Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration.
static bool FindVirtualBaseClass (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *BaseRecord)
 Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration and describes virtual derivation.
static bool FindTagMember (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *Name)
 Base-class lookup callback that determines whether there exists a tag with the given name.
static bool FindOrdinaryMember (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *Name)
 Base-class lookup callback that determines whether there exists a member with the given name.
static bool FindNestedNameSpecifierMember (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)
 Base-class lookup callback that determines whether there exists a member with the given name that can be used in a nested-name-specifier.
static AccessSpecifier MergeAccess (AccessSpecifier PathAccess, AccessSpecifier DeclAccess)
 Calculates the access of a decl that is reached along a path.
static bool classof (const Decl *D)
static bool classofKind (Kind K)

Protected Member Functions

 CXXRecordDecl (Kind K, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl)

Friends

class LazyDefinitionDataPtr< CXXRecordDecl, struct DefinitionData >
class DeclContext
class LambdaExpr
class ASTNodeImporter
class ASTDeclReader
class ASTDeclWriter
class ASTReader
class ASTWriter
void TagDecl::startDefinition ()
void FunctionDecl::setPure (bool)

Detailed Description

Represents a C++ struct/union/class.

Definition at line 285 of file DeclCXX.h.


Member Typedef Documentation

Iterator that traverses the base classes of a class.

Definition at line 649 of file DeclCXX.h.

Definition at line 711 of file DeclCXX.h.

Iterator that traverses the base classes of a class.

Definition at line 646 of file DeclCXX.h.

Definition at line 709 of file DeclCXX.h.

typedef bool clang::CXXRecordDecl::BaseMatchesCallback(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)

Function type used by lookupInBases() to determine whether a specific base class subobject matches the lookup criteria.

Parameters:
Specifierthe base-class specifier that describes the inheritance from the base class we are trying to match.
Paththe current path, from the most-derived class down to the base named by the Specifier.
UserDataa single pointer to user-specified data, provided to lookupInBases().
Returns:
true if this base matched the search criteria, false otherwise.

Definition at line 1499 of file DeclCXX.h.

Definition at line 1063 of file DeclCXX.h.

Definition at line 1064 of file DeclCXX.h.

Definition at line 1077 of file DeclCXX.h.

Iterator access to constructor members.

Definition at line 770 of file DeclCXX.h.

Definition at line 772 of file DeclCXX.h.

typedef bool clang::CXXRecordDecl::ForallBasesCallback(const CXXRecordDecl *BaseDefinition, void *UserData)

Function type used by forallBases() as a callback.

Parameters:
BaseDefinitionthe definition of the base class
Returns:
true if this base matched the search criteria

Definition at line 1464 of file DeclCXX.h.

typedef llvm::iterator_range<friend_iterator> clang::CXXRecordDecl::friend_range

Definition at line 785 of file DeclCXX.h.

Iterator access to method members. The method iterator visits all method members of the class, including non-instance methods, special methods, etc.

Definition at line 751 of file DeclCXX.h.

Definition at line 753 of file DeclCXX.h.


Constructor & Destructor Documentation

CXXRecordDecl::CXXRecordDecl ( Kind  K,
TagKind  TK,
const ASTContext C,
DeclContext DC,
SourceLocation  StartLoc,
SourceLocation  IdLoc,
IdentifierInfo Id,
CXXRecordDecl PrevDecl 
) [protected]

Definition at line 86 of file DeclCXX.cpp.

Referenced by Create(), CreateDeserialized(), and CreateLambda().


Member Function Documentation

Definition at line 713 of file DeclCXX.h.

References bases_begin(), and bases_end().

Referenced by addAssociatedClassesAndNamespaces(), AddIndirectPrimaryBases(), checkMoveAssignmentForRepeatedMove(), clang::Sema::CodeCompleteConstructorInitializer(), CollectVisibleConversions(), clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpec(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), clang::Sema::ComputeInheritingCtorExceptionSpec(), ComputeVMIClassTypeInfoFlags(), clang::Sema::DeclareInheritingConstructors(), DeduceTemplateArgumentsByTypeMatch(), defaultedSpecialMemberIsConstexpr(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseUninitializedReference(), diagnoseUnreadableFields(), DumpCXXRecordLayout(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FindBaseInitializer(), findCircularInheritance(), findDirectBaseWithType(), forallBases(), clang::CXXMethodDecl::getCorrespondingMethodInClass(), getIndirectPrimaryBases(), HasTrivialDestructorBody(), clang::ASTNodeImporter::ImportDefinition(), clang::Sema::inferCUDATargetForImplicitSpecialMember(), clang::CodeGen::CodeGenFunction::InitializeVTablePointers(), clang::NestedNameSpecifier::isDependent(), IsDerivedFromInclusive(), isDirectVBase(), isImmediateBase(), clang::Sema::isMicrosoftMissingTypename(), IsPartOfAST(), isReadByLvalueToRvalueConversion(), isValidBaseClass(), clang::Sema::LookupInSuper(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::Sema::MarkVirtualMembersReferenced(), mayBeAbstract(), recoverFromTypeInKnownDependentBase(), clang::Sema::RequireLiteralType(), RequiresVtordisp(), serializeClassHierarchy(), clang::Sema::SetCtorInitializers(), clang::Sema::ShouldDeleteSpecialMember(), clang::Sema::SubstBaseSpecifiers(), clang::CodeGen::CodeGenModule::TryEmitBaseDestructorAsAlias(), and clang::InheritanceHierarchyWriter::WriteNode().

Definition at line 716 of file DeclCXX.h.

References bases_begin(), and bases_end().

Definition at line 721 of file DeclCXX.h.

References data().

Definition at line 723 of file DeclCXX.h.

References bases_begin(), and data().

MSInheritanceAttr::Spelling CXXRecordDecl::calculateInheritanceModel ( ) const

Calculate what the inheritance model would be for this class.

Definition at line 116 of file AST/MicrosoftCXXABI.cpp.

References getNumVBases(), hasDefinition(), isParsingBaseSpecifiers(), and usesMultipleInheritanceModel().

Referenced by assignInheritanceModel(), and clang::Sema::checkMSInheritanceAttrOnDefinition().

Definition at line 1066 of file DeclCXX.h.

References captures_begin(), and captures_end().

Referenced by RebuildLambdaScopeInfo().

Definition at line 1069 of file DeclCXX.h.

References isLambda().

Referenced by captures(), and captures_end().

Definition at line 1072 of file DeclCXX.h.

References captures_begin(), and isLambda().

Referenced by captures().

static bool clang::CXXRecordDecl::classof ( const Decl D) [inline, static]
static bool clang::CXXRecordDecl::classofKind ( Kind  K) [inline, static]
void CXXRecordDecl::completeDefinition ( ) [override]

Indicates that the definition of this class is now complete.

Reimplemented from clang::TagDecl.

Definition at line 1318 of file DeclCXX.cpp.

Referenced by completeDefinition().

Indicates that the definition of this class is now complete, and provides a final overrider map to help determine.

Parameters:
FinalOverridersThe final overrider map for this class, which can be provided as an optimization for abstract-class checking. If NULL, final overriders will be computed if they are needed to complete the definition.

Definition at line 1322 of file DeclCXX.cpp.

References completeDefinition(), conversion_begin(), conversion_end(), data(), getFinalOverriders(), and mayBeAbstract().

Definition at line 1078 of file DeclCXX.h.

References data(), and clang::Decl::getASTContext().

Referenced by CollectVisibleConversions(), completeDefinition(), and LookupDirect().

Definition at line 1081 of file DeclCXX.h.

References data(), and clang::Decl::getASTContext().

Referenced by CollectVisibleConversions(), completeDefinition(), and LookupDirect().

CXXRecordDecl * CXXRecordDecl::Create ( const ASTContext C,
TagKind  TK,
DeclContext DC,
SourceLocation  StartLoc,
SourceLocation  IdLoc,
IdentifierInfo Id,
CXXRecordDecl PrevDecl = nullptr,
bool  DelayTypeCreation = false 
) [static]
CXXRecordDecl * CXXRecordDecl::CreateLambda ( const ASTContext C,
DeclContext DC,
TypeSourceInfo Info,
SourceLocation  Loc,
bool  DependentLambda,
bool  IsGeneric,
LambdaCaptureDefault  CaptureDefault 
) [static]

Definition at line 776 of file DeclCXX.h.

References clang::DeclContext::decls_begin().

Referenced by ctors().

Definition at line 779 of file DeclCXX.h.

References clang::DeclContext::decls_end().

Referenced by ctors().

Determine whether a defaulted default constructor for this class would be constexpr.

Definition at line 1190 of file DeclCXX.h.

References data(), hasInClassInitializer(), hasVariantMembers(), and clang::TagDecl::isUnion().

Referenced by defaultedSpecialMemberIsConstexpr(), hasConstexprDefaultConstructor(), and hasConstexprNonCopyMoveConstructor().

bool CXXRecordDecl::FindBaseClass ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  BaseRecord 
) [static]

Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration.

This callback can be used with lookupInBases() to determine whether a given derived class has is a base class subobject of a particular type. The user data pointer should refer to the canonical CXXRecordDecl of the base class that we are searching for.

Definition at line 366 of file CXXInheritance.cpp.

References clang::Type::castAs(), getCanonicalDecl(), and clang::CXXBaseSpecifier::getType().

Referenced by isDerivedFrom().

bool CXXRecordDecl::FindNestedNameSpecifierMember ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  UserData 
) [static]

Base-class lookup callback that determines whether there exists a member with the given name that can be used in a nested-name-specifier.

This callback can be used with lookupInBases() to find membes of the given name within a C++ class hierarchy that can occur within nested-name-specifiers.

Definition at line 421 of file CXXInheritance.cpp.

References clang::Type::castAs(), clang::CXXBasePath::Decls, clang::DeclarationName::getFromOpaquePtr(), clang::CXXBaseSpecifier::getType(), clang::Decl::IDNS_Tag, and clang::DeclContext::lookup().

Referenced by clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::FindOrdinaryMember ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  Name 
) [static]

Base-class lookup callback that determines whether there exists a member with the given name.

This callback can be used with lookupInBases() to find members of the given name within a C++ class hierarchy. The user data pointer is an opaque DeclarationName pointer.

Definition at line 402 of file CXXInheritance.cpp.

References clang::Type::castAs(), clang::CXXBasePath::Decls, clang::DeclarationName::getFromOpaquePtr(), clang::CXXBaseSpecifier::getType(), clang::Decl::IDNS_Member, clang::Decl::IDNS_Ordinary, clang::Decl::IDNS_Tag, and clang::DeclContext::lookup().

Referenced by hasMember(), and clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::FindTagMember ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  Name 
) [static]

Base-class lookup callback that determines whether there exists a tag with the given name.

This callback can be used with lookupInBases() to find tag members of the given name within a C++ class hierarchy. The user data pointer is an opaque DeclarationName pointer.

Definition at line 385 of file CXXInheritance.cpp.

References clang::Type::castAs(), clang::CXXBasePath::Decls, clang::DeclarationName::getFromOpaquePtr(), clang::CXXBaseSpecifier::getType(), clang::Decl::IDNS_Tag, and clang::DeclContext::lookup().

Referenced by clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::FindVirtualBaseClass ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  BaseRecord 
) [static]

Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration and describes virtual derivation.

This callback can be used with lookupInBases() to determine whether a given derived class has is a virtual base class subobject of a particular type. The user data pointer should refer to the canonical CXXRecordDecl of the base class that we are searching for.

Definition at line 375 of file CXXInheritance.cpp.

References clang::Type::castAs(), getCanonicalDecl(), clang::CXXBaseSpecifier::getType(), and clang::CXXBaseSpecifier::isVirtual().

Referenced by isVirtuallyDerivedFrom().

bool CXXRecordDecl::forallBases ( ForallBasesCallback BaseMatches,
void *  UserData,
bool  AllowShortCircuit = true 
) const

Determines if the given callback holds for all the direct or indirect base classes of this type.

The class itself does not count as a base class. This routine returns false if the class has non-computable base classes.

Parameters:
BaseMatchesCallback invoked for each (direct or indirect) base class of this type, or if AllowShortCircuit is true then until a call returns false.
UserDataPassed as the second argument of every call to BaseMatches.
AllowShortCircuitif false, forces the callback to be called for every base class, even if a dependent or non-matching base was found.

Definition at line 132 of file CXXInheritance.cpp.

References bases(), clang::Type::getAs(), clang::RecordType::getDecl(), clang::RecordDecl::getDefinition(), isCurrentInstantiation(), clang::DeclContext::isDependentContext(), and Record.

Referenced by clang::Sema::CheckUsingDeclQualifier(), hasAnyDependentBases(), isProvablyNotDerivedFrom(), and isProvablyNotDerivedFrom().

Definition at line 227 of file DeclFriend.h.

Referenced by friends(), and IsRecordFullyDefined().

Definition at line 231 of file DeclFriend.h.

Referenced by friends(), and IsRecordFullyDefined().

Definition at line 235 of file DeclFriend.h.

References friend_begin(), and friend_end().

Referenced by GetFriendKind().

CXXRecordDecl* clang::CXXRecordDecl::getCanonicalDecl ( ) [inline, override, virtual]
virtual const CXXRecordDecl* clang::CXXRecordDecl::getCanonicalDecl ( ) const [inline, virtual]

Reimplemented from clang::TagDecl.

Definition at line 654 of file DeclCXX.h.

References getCanonicalDecl().

void CXXRecordDecl::getCaptureFields ( llvm::DenseMap< const VarDecl *, FieldDecl * > &  Captures,
FieldDecl *&  ThisCapture 
) const

For a closure type, retrieve the mapping from captured variables and this to the non-static data members that store the values or references of the captures.

Parameters:
CapturesWill be populated with the mapping from captured variables to the corresponding fields.
ThisCaptureWill be set to the field declaration for the this capture.
Note:
No entries will be added for init-captures, as they do not capture variables.

Definition at line 1022 of file DeclCXX.cpp.

Referenced by clang::CodeGen::CodeGenFunction::StartFunction().

Retrieves the class template that is described by this class declaration.

Every class template is represented as a ClassTemplateDecl and a CXXRecordDecl. The former contains template properties (such as the template parameter lists) while the latter contains the actual description of the template's contents. ClassTemplateDecl::getTemplatedDecl() retrieves the CXXRecordDecl that from a ClassTemplateDecl, while getDescribedClassTemplate() retrieves the ClassTemplateDecl from a CXXRecordDecl.

Definition at line 1364 of file DeclCXX.h.

Referenced by clang::Sema::ActOnReenterTemplateScope(), clang::Sema::ActOnStartCXXMemberDeclarations(), checkDLLAttribute(), clang::Sema::CheckTemplateIdType(), clang::Sema::FinalizeDeclaration(), clang::Sema::FindInstantiatedDecl(), MatchesFriend(), clang::Sema::MergeCXXFunctionDecl(), clang::Sema::mergeMSInheritanceAttr(), NeedsInjectedClassNameType(), recoverFromTypeInKnownDependentBase(), clang::ASTNodeImporter::VisitClassTemplateDecl(), and clang::ASTDeclWriter::VisitCXXRecordDecl().

void CXXRecordDecl::getFinalOverriders ( CXXFinalOverriderMap FinaOverriders) const

Retrieve the final overriders for each virtual member function in the class hierarchy where this class is the most-derived class in the class hierarchy.

Definition at line 626 of file CXXInheritance.cpp.

References clang::Decl::Hidden.

Referenced by completeDefinition(), clang::Sema::DiagnoseAbstractType(), and clang::Sema::MarkVirtualMembersReferenced().

Retrieve the generic lambda's template parameter list. Returns null if the class does not represent a lambda or a generic lambda.

Definition at line 1041 of file DeclCXX.cpp.

References clang::FunctionDecl::getDescribedFunctionTemplate(), getLambdaCallOperator(), and isLambda().

Referenced by clang::LambdaExpr::getTemplateParameterList().

Get the indirect primary bases for this class.

Definition at line 709 of file CXXInheritance.cpp.

References AddIndirectPrimaryBases(), bases(), clang::Decl::getASTContext(), and getNumVBases().

If this record is an instantiation of a member class, retrieves the member class from which it was instantiated.

This routine will return non-null for (non-templated) member classes of class templates. For example, given:

 template<typename T>
 struct X {
   struct A { };
 };

The declaration for X<int>::A is a (non-templated) CXXRecordDecl whose parent is the class template specialization X<int>. For this declaration, getInstantiatedFromMemberClass() will return the CXXRecordDecl X<T>::A. When a complete definition of X<int>::A is required, it will be instantiated from the declaration returned by getInstantiatedFromMemberClass().

Definition at line 1220 of file DeclCXX.cpp.

References getMemberSpecializationInfo().

Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckMemberSpecialization(), getExplicitVisibilityAux(), getTemplateInstantiationPattern(), clang::Sema::InstantiateClass(), and isInstantiationOf().

Definition at line 1043 of file DeclCXX.h.

References isLambda().

Referenced by RebuildLambdaScopeInfo().

Retrieve the declaration that provides additional context for a lambda, when the normal declaration context is not specific enough.

Certain contexts (default arguments of in-class function parameters and the initializers of data members) have separate name mangling rules for lambdas within the Itanium C++ ABI. For these cases, this routine provides the declaration in which the lambda occurs, e.g., the function parameter or the non-static data member. Otherwise, it returns NULL to imply that the declaration context suffices.

Definition at line 1643 of file DeclCXX.h.

References isLambda().

Referenced by computeLVForDecl().

If this is the closure type of a lambda expression, retrieve the number to be used for name mangling in the Itanium C++ ABI.

Zero indicates that this closure type has internal linkage, so the mangling number does not matter, while a non-zero value indicates which lambda expression this is in this particular context.

Definition at line 1629 of file DeclCXX.h.

References isLambda().

Referenced by computeLVForDecl().

Retrieve the lambda static invoker, the address of which is returned by the conversion operator, and the body of which is forwarded to the lambda call operator.

Definition at line 1007 of file DeclCXX.cpp.

References clang::IdentifierTable::get(), clang::Decl::getASTContext(), clang::getLambdaStaticInvokerName(), clang::ASTContext::Idents, isLambda(), and clang::DeclContext::lookup().

Referenced by clang::Sema::DefineImplicitLambdaToFunctionPointerConversion(), and clang::CXXMethodDecl::isLambdaStaticInvoker().

Definition at line 1691 of file DeclCXX.h.

If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.

Definition at line 1344 of file DeclCXX.h.

Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckMemberSpecialization(), getInstantiatedFromMemberClass(), getTemplateInstantiationPattern(), getTemplateSpecializationKind(), clang::Sema::InstantiateClass(), setTemplateSpecializationKind(), and clang::ASTDeclWriter::VisitCXXRecordDecl().

Returns the most recent (re)declaration of this declaration.

Reimplemented from clang::RecordDecl.

Definition at line 671 of file DeclCXX.h.

References getMostRecentDecl().

MSInheritanceAttr::Spelling CXXRecordDecl::getMSInheritanceModel ( ) const

Returns the inheritance model used for this record.

Definition at line 127 of file AST/MicrosoftCXXABI.cpp.

Referenced by getInheritanceFromMemptr(), getMSMemberPointerSlots(), and nullFieldOffsetIsZero().

MSVtorDispAttr::Mode CXXRecordDecl::getMSVtorDispMode ( ) const

Controls when vtordisps will be emitted if this record is used as a virtual base.

Definition at line 133 of file AST/MicrosoftCXXABI.cpp.

References clang::Decl::getASTContext().

Reimplemented from clang::RecordDecl.

Definition at line 662 of file DeclCXX.h.

References getPreviousDecl().

Retrieve the record declaration from which this record could be instantiated. Returns null if this class is not a template instantiation.

Definition at line 1264 of file DeclCXX.cpp.

References getInstantiatedFromMemberClass(), getMemberSpecializationInfo(), getTemplateSpecializationKind(), and clang::isTemplateInstantiation().

Referenced by clang::Sema::BuildCXXDefaultInitExpr(), getDefiningModule(), getTemplateInstantiationPattern(), and clang::Sema::InstantiateClassMembers().

Definition at line 1384 of file DeclCXX.h.

References getTemplateInstantiationPattern().

Get all conversion functions visible in current class, including conversion function templates.

getVisibleConversionFunctions - get all conversion functions visible in current class; including conversion function templates.

Definition at line 1177 of file DeclCXX.cpp.

References bases_begin(), bases_end(), clang::ASTUnresolvedSet::begin(), CollectVisibleConversions(), data(), clang::ASTUnresolvedSet::end(), and clang::Decl::getASTContext().

Referenced by CollectVRQualifiers(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().

Determine whether this class has any dependent base classes which are not the current instantiation.

Definition at line 394 of file DeclCXX.cpp.

References forallBases(), clang::DeclContext::isDependentContext(), and SawBase().

Referenced by clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::CheckOverrideControl(), clang::Sema::LookupQualifiedName(), and recoverFromMSUnqualifiedLookup().

Determine whether this class has a constexpr default constructor.

Definition at line 1196 of file DeclCXX.h.

References data(), defaultedDefaultConstructorIsConstexpr(), and needsImplicitDefaultConstructor().

Referenced by setBases().

Determine whether this class has at least one constexpr constructor other than the copy or move constructors.

Definition at line 1182 of file DeclCXX.h.

References data(), defaultedDefaultConstructorIsConstexpr(), and needsImplicitDefaultConstructor().

Referenced by isLiteral(), and clang::Sema::RequireLiteralType().

Determine whether this class has a copy assignment operator with a parameter type which is a reference to a const-qualified type or is not a reference.

Definition at line 954 of file DeclCXX.h.

References data(), implicitCopyAssignmentHasConstParam(), and needsImplicitCopyAssignment().

Referenced by setBases().

Determine whether this class has a copy constructor with a parameter type which is a reference to a const-qualified type.

Definition at line 872 of file DeclCXX.h.

References data(), implicitCopyConstructorHasConstParam(), and needsImplicitCopyConstructor().

Referenced by setBases().

Determine whether this class has any default constructors.

Definition at line 818 of file DeclCXX.h.

References data(), and needsImplicitDefaultConstructor().

Referenced by hasTrivialDefaultConstructor(), TryConstructorInitialization(), and TryListInitialization().

Determines whether this record has any friends.

Definition at line 794 of file DeclCXX.h.

References data().

Whether this class has any in-class initializers for non-static data members (including those in anonymous unions or structs).

Definition at line 1104 of file DeclCXX.h.

References data().

Referenced by checkDuplicateDefaultInit(), defaultedDefaultConstructorIsConstexpr(), and findDefaultInitializer().

Determine whether this class has a destructor which has no semantic effect.

Any such destructor will be trivial, public, defaulted and not deleted, and will call only irrelevant destructors.

Definition at line 1275 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::CheckCXXThrowOperand(), clang::Sema::CheckParmsForFunctionDef(), clang::Sema::FinalizeVarWithDestructor(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), and setBases().

Determine whether this class has a move assignment operator.

Definition at line 967 of file DeclCXX.h.

References data(), and needsImplicitMoveAssignment().

Referenced by hasSimpleMoveAssignment(), and hasTrivialMoveAssignment().

Determine whether this class has a move constructor.

Definition at line 895 of file DeclCXX.h.

References data(), and needsImplicitMoveConstructor().

Referenced by hasSimpleMoveConstructor(), and hasTrivialMoveConstructor().

Determine whether this class, or any of its class subobjects, contains a mutable field.

Definition at line 1160 of file DeclCXX.h.

References data().

Referenced by diagnoseUnreadableFields(), and setBases().

Determine whether this class has a non-literal or/ volatile type non-static data member or base class.

Definition at line 1281 of file DeclCXX.h.

References data().

Referenced by isLiteral(), clang::Sema::RequireLiteralType(), and setBases().

Determine whether this class has a non-trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)

Definition at line 1238 of file DeclCXX.h.

References data(), and hasTrivialCopyAssignment().

Referenced by clang::Sema::CheckNontrivialField(), EvaluateUnaryTypeTrait(), and isTriviallyCopyable().

Determine whether this class has a non-trivial copy constructor (C++ [class.copy]p6, C++11 [class.copy]p12)

Definition at line 1210 of file DeclCXX.h.

References data(), and hasTrivialCopyConstructor().

Referenced by clang::CodeGen::CGCXXABI::canCopyArgument(), clang::Sema::CheckNontrivialField(), and isTriviallyCopyable().

Determine whether this class has a non-trivial default constructor (C++11 [class.ctor]p5).

Definition at line 1174 of file DeclCXX.h.

References data(), and needsImplicitDefaultConstructor().

Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)

Definition at line 1266 of file DeclCXX.h.

References data().

Referenced by clang::CodeGen::CGCXXABI::canCopyArgument(), clang::Sema::CheckNontrivialField(), clang::CodeGen::CodeGenFunction::EmitCallArg(), and clang::CodeGen::CodeGenFunction::EmitParmDecl().

Determine whether this class has a non-trivial move assignment operator (C++11 [class.copy]p25)

Definition at line 1252 of file DeclCXX.h.

References data(), and needsImplicitMoveAssignment().

Referenced by checkMoveAssignmentForRepeatedMove(), EvaluateUnaryTypeTrait(), and isTriviallyCopyable().

Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12)

Definition at line 1224 of file DeclCXX.h.

References data(), and needsImplicitMoveConstructor().

Referenced by clang::CodeGen::CGCXXABI::canCopyArgument(), and isTriviallyCopyable().

true if we know for sure that this class has an accessible destructor that is not deleted.

Definition at line 812 of file DeclCXX.h.

References data(), and hasUserDeclaredDestructor().

true if we know for sure that this class has a single, accessible, unambiguous move assignment operator that is not deleted.

Definition at line 806 of file DeclCXX.h.

References data(), hasMoveAssignment(), and hasUserDeclaredMoveAssignment().

true if we know for sure that this class has a single, accessible, unambiguous move constructor that is not deleted.

Definition at line 800 of file DeclCXX.h.

References data(), hasMoveConstructor(), and hasUserDeclaredMoveConstructor().

Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)

Definition at line 1232 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitCopyAssignment(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), EvaluateUnaryTypeTrait(), findTrivialSpecialMember(), hasNonTrivialCopyAssignment(), and setBases().

Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class.copy]p12)

Definition at line 1204 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitCopyConstructor(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), findTrivialSpecialMember(), hasNonTrivialCopyConstructor(), and setBases().

Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).

Definition at line 1167 of file DeclCXX.h.

References data(), and hasDefaultConstructor().

Referenced by clang::Sema::CheckNontrivialField(), clang::Sema::DeclareImplicitDefaultConstructor(), findTrivialSpecialMember(), isLiteral(), isTrivial(), clang::Sema::RequireLiteralType(), and setBases().

Determine whether this class has a trivial move assignment operator (C++11 [class.copy]p25)

Definition at line 1245 of file DeclCXX.h.

References data(), and hasMoveAssignment().

Referenced by checkMoveAssignmentForRepeatedMove(), clang::Sema::DeclareImplicitMoveAssignment(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), EvaluateUnaryTypeTrait(), and setBases().

Determine whether this class has a trivial move constructor (C++11 [class.copy]p12)

Definition at line 1217 of file DeclCXX.h.

References data(), and hasMoveConstructor().

Referenced by clang::Sema::DeclareImplicitMoveConstructor(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), and setBases().

Whether this class or any of its subobjects has any members of reference type which would make value-initialization ill-formed.

Per C++03 [dcl.init]p5:

  • if T is a non-union class type without a user-declared constructor, then every non-static data member and base-class component of T is value-initialized [...] A program that calls for [...] value-initialization of an entity of reference type is ill-formed.

Definition at line 1114 of file DeclCXX.h.

References data(), hasUserDeclaredConstructor(), and clang::TagDecl::isUnion().

Referenced by DiagnoseUninitializedReference(), and setBases().

Determine whether this class has any user-declared constructors.

When true, a default constructor will not be implicitly declared.

Definition at line 835 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), CheckAggExprForMemSetUse(), clang::Sema::CheckCompletedCXXClass(), and hasUninitializedReferenceMember().

Determine whether this class has a user-declared copy assignment operator.

When false, a copy assigment operator will be implicitly declared.

Definition at line 929 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), needsImplicitMoveAssignment(), and needsImplicitMoveConstructor().

Determine whether this class has a user-declared copy constructor.

When false, a copy constructor will be implicitly declared.

Definition at line 848 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), needsImplicitMoveAssignment(), and needsImplicitMoveConstructor().

Determine whether this class has a user-declared destructor.

When false, a destructor will be implicitly declared.

Definition at line 1001 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), hasSimpleDestructor(), clang::Sema::MarkVTableUsed(), needsImplicitMoveAssignment(), and needsImplicitMoveConstructor().

Determine whether this class has had a move assignment declared by the user.

Definition at line 962 of file DeclCXX.h.

References data().

Referenced by hasSimpleMoveAssignment(), needsImplicitMoveConstructor(), and clang::Sema::ShouldDeleteSpecialMember().

Determine whether this class has had a move constructor declared by the user.

Definition at line 890 of file DeclCXX.h.

References data().

Referenced by hasSimpleMoveConstructor(), needsImplicitMoveAssignment(), and clang::Sema::ShouldDeleteSpecialMember().

Whether this class has a user-declared move constructor or assignment operator.

When false, a move constructor and assignment operator may be implicitly declared.

Definition at line 883 of file DeclCXX.h.

References data().

Whether this class has a user-provided default constructor per C++11.

Definition at line 841 of file DeclCXX.h.

References data().

Referenced by clang::Sema::getFixItZeroInitializerForType(), and warnAboutAmbiguousFunction().

Determine whether this class has any variant members.

Definition at line 1163 of file DeclCXX.h.

References data().

Referenced by CheckConstexprCtorInitializer(), clang::Sema::CheckConstexprFunctionBody(), and defaultedDefaultConstructorIsConstexpr().

Determine whether an implicit copy assignment operator for this type would have a parameter with a const-qualified reference type.

Definition at line 947 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::DeclareImplicitCopyAssignment(), and hasCopyAssignmentWithConstParam().

Determine whether an implicit copy constructor for this type would have a parameter with a const-qualified reference type.

Definition at line 866 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::DeclareImplicitCopyConstructor(), and hasCopyConstructorWithConstParam().

Determine whether this class has a pure virtual function.

The class is is abstract per (C++ [class.abstract]p2) if it declares a pure virtual function or inherits a pure virtual function that is not overridden.

Definition at line 1152 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::CheckCompletedCXXClass(), evaluateTypeTrait(), clang::Sema::inferCUDATargetForImplicitSpecialMember(), mayBeAbstract(), clang::Sema::RequireNonAbstractType(), clang::Sema::SetCtorInitializers(), and clang::Sema::ShouldDeleteSpecialMember().

Determine whether this class is an aggregate (C++ [dcl.init.aggr]), which is a class with no user-declared constructors, no private or protected non-static data members, no base classes, and no virtual functions (C++ [dcl.init.aggr]p1).

Definition at line 1099 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckCompletedCXXClass(), clang::Sema::getFixItZeroInitializerForType(), isLiteral(), and clang::Sema::RequireLiteralType().

True if this class is C-like, without C++-specific features, e.g. it contains only public fields, no bases, tag kind is not 'class', etc.

Definition at line 975 of file DeclCXX.cpp.

References data(), clang::TagDecl::getTagKind(), hasDefinition(), isPOD(), clang::TTK_Class, and clang::TTK_Interface.

Referenced by clang::Sema::ActOnFields().

Determine whether this dependent class is a current instantiation, when viewed from within the given context.

Definition at line 122 of file CXXInheritance.cpp.

References clang::DeclContext::Equals(), clang::DeclContext::getParent(), clang::DeclContext::isDependentContext(), and clang::DeclContext::isFileContext().

Referenced by forallBases(), and getCurrentInstantiationOf().

Determine whether this lambda expression was known to be dependent at the time it was created, even if its context does not appear to be dependent.

This flag is a workaround for an issue with parsing, where default arguments are parsed before their enclosing function declarations have been created. This means that any lambda expressions within those default arguments will have as their DeclContext the context enclosing the function declaration, which may be non-dependent even when the function declaration itself is dependent. This flag indicates when we know that the lambda is dependent despite that.

Definition at line 1687 of file DeclCXX.h.

References isLambda().

Determine whether this class is derived from the class Base.

This routine only determines whether this class is derived from Base, but does not account for factors that may make a Derived -> Base class ill-formed, such as private/protected inheritance or multiple, ambiguous base class subobjects.

Parameters:
Basethe base class we are searching for.
Returns:
true if this class is derived from Base, false otherwise.

Definition at line 76 of file CXXInheritance.cpp.

Referenced by adjustReturnValue(), computeOffsetHint(), DiagnoseReinterpretUpDownCast(), FindBestPath(), clang::CXXDynamicCastExpr::isAlwaysNull(), clang::Sema::IsDerivedFrom(), and clang::FunctionCallFilterCCC::ValidateCandidate().

bool CXXRecordDecl::isDerivedFrom ( const CXXRecordDecl Base,
CXXBasePaths Paths 
) const

Determine whether this class is derived from the type Base.

This routine only determines whether this class is derived from Base, but does not account for factors that may make a Derived -> Base class ill-formed, such as private/protected inheritance or multiple, ambiguous base class subobjects.

Parameters:
Basethe base class we are searching for.
Pathswill contain the paths taken from the current class to the given Base class.
Returns:
true if this class is derived from Base, false otherwise.
Todo:
add a separate paramaeter to configure IsDerivedFrom, rather than tangling input and output in Paths

Definition at line 82 of file CXXInheritance.cpp.

References FindBaseClass(), getCanonicalDecl(), lookupInBases(), and clang::CXXBasePaths::setOrigin().

bool clang::CXXRecordDecl::isEmpty ( ) const [inline]

Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).

A non-union class is empty iff it has a virtual function, virtual base, data member (other than 0-width bit-field) or inherits from a non-empty class.

Note:
This does NOT include a check for union-ness.

Definition at line 1141 of file DeclCXX.h.

References data().

Referenced by CanUseSingleInheritance(), CheckConstexprCtorInitializer(), DumpCXXRecordLayout(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNullBaseClassInitialization(), EmitNullConstant(), isReadByLvalueToRvalueConversion(), setBases(), and warnAboutAmbiguousFunction().

Determine whether this class is a literal type.

C++11 [basic.types]p10: A class type that has all the following properties:

  • it has a trivial destructor
  • every constructor call and full-expression in the brace-or-equal-intializers for non-static data members (if any) is a constant expression.
  • it is an aggregate type or has at least one constexpr constructor or constructor template that is not a copy or move constructor, and
  • all of its non-static data members and base classes are of literal types

We resolve DR1361 by ignoring the second bullet. We resolve DR1452 by treating types with trivial default constructors as literal types.

Definition at line 1313 of file DeclCXX.h.

References hasConstexprNonCopyMoveConstructor(), hasNonLiteralTypeFieldsOrBases(), hasTrivialDefaultConstructor(), hasTrivialDestructor(), and isAggregate().

Referenced by clang::Sema::CheckCompletedCXXClass(), and defaultedSpecialMemberIsConstexpr().

If the class is a local class [class.local], returns the enclosing function declaration.

Definition at line 1394 of file DeclCXX.h.

References clang::Decl::getDeclContext().

Referenced by clang::Sema::InstantiateClassMembers(), isLocalClass(), and clang::Sema::MarkVTableUsed().

Definition at line 1401 of file DeclCXX.h.

References isLocalClass().

Definition at line 699 of file DeclCXX.h.

References data().

Referenced by calculateInheritanceModel().

bool clang::CXXRecordDecl::isPOD ( ) const [inline]

Whether this class is a POD-type (C++ [class]p4)

For purposes of this function a class is POD if it is an aggregate that has no non-static non-POD data members, no reference data members, no user-defined copy assignment operator and no user-defined destructor.

Note that this is the C++ TR1 definition of POD.

Definition at line 1127 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnUninitializedDecl(), GetDiagForGotoScopeDecl(), isCLike(), and mustSkipTailPadding().

Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inherits a virtual function.

Definition at line 1145 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::BuildCXXTypeId(), clang::Sema::CheckCompletedCXXClass(), computeKeyFunction(), nullFieldOffsetIsZero(), setBases(), and usesMultipleInheritanceModel().

Determine whether this class is provably not derived from the type Base.

Definition at line 116 of file CXXInheritance.cpp.

References BaseIsNot(), forallBases(), and getCanonicalDecl().

Referenced by clang::Sema::CheckQualifiedMemberReference().

Determine whether this class has standard layout per (C++ [class]p7)

Definition at line 1156 of file DeclCXX.h.

References data().

Referenced by clang::RecordDecl::mayInsertExtraPadding(), mustSkipTailPadding(), and setBases().

Determine whether this class is considered trivial.

C++11 [class]p6: "A trivial class is a class that has a trivial default constructor and is trivially copiable."

Definition at line 1294 of file DeclCXX.h.

References hasTrivialDefaultConstructor(), and isTriviallyCopyable().

Referenced by mustSkipTailPadding().

Determine whether this class is considered trivially copyable per (C++11 [class]p6).

Definition at line 401 of file DeclCXX.cpp.

References hasNonTrivialCopyAssignment(), hasNonTrivialCopyConstructor(), hasNonTrivialMoveAssignment(), hasNonTrivialMoveConstructor(), and hasTrivialDestructor().

Referenced by isTrivial(), and clang::RecordDecl::mayInsertExtraPadding().

Determine whether this class is virtually derived from the class Base.

This routine only determines whether this class is virtually derived from Base, but does not account for factors that may make a Derived -> Base class ill-formed, such as private/protected inheritance or multiple, ambiguous base class subobjects.

Parameters:
Basethe base class we are searching for.
Returns:
true if this class is virtually derived from Base, false otherwise.

Definition at line 93 of file CXXInheritance.cpp.

References FindVirtualBaseClass(), getCanonicalDecl(), getNumVBases(), lookupInBases(), and clang::CXXBasePaths::setOrigin().

Referenced by clang::ento::MemRegion::getAsOffset(), isValidBaseClass(), and lookupInBases().

bool CXXRecordDecl::lookupInBases ( BaseMatchesCallback BaseMatches,
void *  UserData,
CXXBasePaths Paths 
) const

Look for entities within the base classes of this C++ class, transitively searching all base class subobjects.

This routine uses the callback function BaseMatches to find base classes meeting some search criteria, walking all base class subobjects and populating the given Paths structure with the paths through the inheritance hierarchy that resulted in a match. On a successful search, the Paths structure can be queried to retrieve the matching paths and to determine if there were any ambiguities.

Parameters:
BaseMatchescallback function used to determine whether a given base matches the user-defined search criteria.
UserDatauser data pointer that will be provided to BaseMatches.
Pathsused to record the paths from this class to its base class subobjects that match the search criteria.
Returns:
true if there exists any path from this class to a base class subobject that matches the search criteria.

Definition at line 299 of file CXXInheritance.cpp.

References clang::CXXBasePaths::begin(), clang::CXXBasePaths::end(), clang::Decl::getASTContext(), clang::Decl::Hidden, clang::CXXBasePaths::isFindingAmbiguities(), clang::CXXBasePaths::isRecordingPaths(), isVirtuallyDerivedFrom(), and P.

Referenced by clang::Sema::AddOverriddenMethods(), clang::Sema::FindHiddenVirtualMethods(), hasMember(), isDerivedFrom(), isVirtuallyDerivedFrom(), and clang::Sema::LookupQualifiedName().

Determine whether this class may end up being abstract, even though it is not yet known to be abstract.

Returns:
true if this class is not known to be abstract but has any base classes that are abstract. In this case, completeDefinition() will need to compute final overriders to determine whether the class is actually abstract.

Definition at line 1363 of file DeclCXX.cpp.

References bases(), data(), isAbstract(), clang::DeclContext::isDependentContext(), and clang::Decl::isInvalidDecl().

Referenced by completeDefinition().

static AccessSpecifier clang::CXXRecordDecl::MergeAccess ( AccessSpecifier  PathAccess,
AccessSpecifier  DeclAccess 
) [inline, static]

Calculates the access of a decl that is reached along a path.

Definition at line 1591 of file DeclCXX.h.

References clang::AS_none, and clang::AS_private.

Referenced by CollectVisibleConversions(), and clang::Sema::LookupQualifiedName().

Method begin iterator. Iterates in the order the methods were declared.

Definition at line 761 of file DeclCXX.h.

References clang::DeclContext::decls_begin().

Referenced by methods(), and shouldOmitDefinition().

Method past-the-end iterator.

Definition at line 765 of file DeclCXX.h.

References clang::DeclContext::decls_end().

Referenced by methods(), and shouldOmitDefinition().

Determine whether this class needs an implicit copy assignment operator to be lazily declared.

Definition at line 935 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::ForceDeclarationOfImplicitMembers(), hasCopyAssignmentWithConstParam(), and clang::Sema::LookupSpecialMember().

Determine whether this class needs an implicit copy constructor to be lazily declared.

Definition at line 854 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::ForceDeclarationOfImplicitMembers(), hasCopyConstructorWithConstParam(), clang::Sema::LookupConstructors(), and clang::Sema::LookupSpecialMember().

Determine whether this class needs an implicit destructor to be lazily declared.

Definition at line 1007 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitDestructor(), findTrivialSpecialMember(), clang::Sema::ForceDeclarationOfImplicitMembers(), and clang::Sema::LookupSpecialMember().

Determine whether we need to eagerly declare a defaulted copy assignment operator for this class.

Definition at line 941 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), and clang::Sema::DeclareImplicitCopyAssignment().

Determine whether we need to eagerly declare a defaulted copy constructor for this class.

Definition at line 860 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), and clang::Sema::DeclareImplicitCopyConstructor().

Determine whether we need to eagerly declare a destructor for this class.

Definition at line 1013 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass().

Determine whether we need to eagerly declare a move assignment operator for this class.

Definition at line 994 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), clang::Sema::DeclareImplicitMoveAssignment(), and setImplicitMoveAssignmentIsDeleted().

Determine whether we need to eagerly declare a defaulted move constructor for this class.

Definition at line 921 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), clang::Sema::DeclareImplicitMoveConstructor(), and setImplicitMoveConstructorIsDeleted().

In the Microsoft C++ ABI, use zero for the field offset of a null data member pointer if we can guarantee that zero is not a valid field offset, or if the member pointer has multiple fields. Polymorphic classes have a vfptr at offset zero, so we can use zero for null. If there are multiple fields, we can use zero even if it is a valid field offset because null-ness testing will check the other fields.

Definition at line 1666 of file DeclCXX.h.

References getMSInheritanceModel(), hasDefinition(), and isPolymorphic().

Definition at line 239 of file DeclFriend.h.

References data().

Removes a conversion function from this class. The conversion function must currently be a member of this class. Furthermore, this class must currently be in the process of being defined.

Definition at line 1195 of file DeclCXX.cpp.

References clang::ASTUnresolvedSet::begin(), data(), clang::ASTUnresolvedSet::end(), clang::ASTUnresolvedSet::erase(), clang::Decl::getASTContext(), and clang::ASTUnresolvedSet::size().

void CXXRecordDecl::setBases ( CXXBaseSpecifier const *const *  Bases,
unsigned  NumBases 
)

Set that we attempted to declare an implicit move assignment operator, but overload resolution failed so we deleted it.

Definition at line 974 of file DeclCXX.h.

References data(), and needsOverloadResolutionForMoveAssignment().

Referenced by clang::Sema::DeclareImplicitMoveAssignment().

Set that we attempted to declare an implicitly move constructor, but overload resolution failed so we deleted it.

Definition at line 902 of file DeclCXX.h.

References data(), and needsOverloadResolutionForMoveConstructor().

Referenced by clang::Sema::DeclareImplicitMoveConstructor().

Specify that this record is an instantiation of the member class RD.

Definition at line 1228 of file DeclCXX.cpp.

References clang::Decl::getASTContext().

Definition at line 697 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnBaseSpecifier().

void clang::CXXRecordDecl::setLambdaMangling ( unsigned  ManglingNumber,
Decl ContextDecl 
) [inline]

Set the mangling number and context declaration for a lambda class.

Definition at line 1650 of file DeclCXX.h.

Referenced by clang::Sema::startLambdaDefinition().

Set the kind of specialization or template instantiation this is.

Definition at line 1249 of file DeclCXX.cpp.

References getMemberSpecializationInfo().

Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckMemberSpecialization(), clang::Sema::InstantiateClass(), and clang::ASTDeclReader::UpdateDecl().

Definition at line 733 of file DeclCXX.h.

References vbases_begin(), and vbases_end().

Definition at line 737 of file DeclCXX.h.

References data().

Referenced by vbases(), and vbases_end().

Definition at line 738 of file DeclCXX.h.

References data().

Definition at line 739 of file DeclCXX.h.

References data(), and vbases_begin().

Referenced by vbases().

Definition at line 740 of file DeclCXX.h.

References data(), and vbases_begin().

Renders and displays an inheritance diagram for this C++ class and all of its base classes (transitively) using GraphViz.

viewInheritance - Display the inheritance hierarchy of this C++ class using GraphViz.

Definition at line 137 of file InheritViz.cpp.

References clang::QualType::getAsString(), clang::ASTContext::getTypeDeclType(), and clang::InheritanceHierarchyWriter::WriteGraph().


Friends And Related Function Documentation

friend class ASTDeclReader [friend]

Reimplemented from clang::TagDecl.

Reimplemented in clang::ClassTemplatePartialSpecializationDecl, and clang::ClassTemplateSpecializationDecl.

Definition at line 1700 of file DeclCXX.h.

friend class ASTDeclWriter [friend]

Reimplemented from clang::TagDecl.

Reimplemented in clang::ClassTemplatePartialSpecializationDecl, and clang::ClassTemplateSpecializationDecl.

Definition at line 1701 of file DeclCXX.h.

friend class ASTNodeImporter [friend]

Definition at line 633 of file DeclCXX.h.

friend class ASTReader [friend]

Reimplemented from clang::Decl.

Definition at line 1702 of file DeclCXX.h.

friend class ASTWriter [friend]

Reimplemented from clang::DeclContext.

Definition at line 1703 of file DeclCXX.h.

friend class DeclContext [friend]

Reimplemented from clang::RecordDecl.

Definition at line 616 of file DeclCXX.h.

void FunctionDecl::setPure ( bool  ) [friend]
friend class LambdaExpr [friend]

Definition at line 617 of file DeclCXX.h.

friend class LazyDefinitionDataPtr< CXXRecordDecl, struct DefinitionData > [friend]

Definition at line 525 of file DeclCXX.h.

void TagDecl::startDefinition ( ) [friend]

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