clang 20.0.0git
|
Declaration of a class template. More...
#include "clang/AST/DeclTemplate.h"
Classes | |
struct | Common |
Data that is common to all of the declarations of a given class template. More... | |
Public Types | |
using | spec_iterator = SpecIterator< ClassTemplateSpecializationDecl > |
using | spec_range = llvm::iterator_range< spec_iterator > |
![]() | |
using | redecl_range = redeclarable_base::redecl_range |
using | redecl_iterator = redeclarable_base::redecl_iterator |
![]() | |
enum | ExplicitVisibilityKind { VisibilityForType , VisibilityForValue } |
Kinds of explicit visibility. More... | |
![]() | |
enum | Kind |
Lists the kind of concrete classes of Decl. More... | |
enum | IdentifierNamespace { IDNS_Label = 0x0001 , IDNS_Tag = 0x0002 , IDNS_Type = 0x0004 , IDNS_Member = 0x0008 , IDNS_Namespace = 0x0010 , IDNS_Ordinary = 0x0020 , IDNS_ObjCProtocol = 0x0040 , IDNS_OrdinaryFriend = 0x0080 , IDNS_TagFriend = 0x0100 , IDNS_Using = 0x0200 , IDNS_NonMemberOperator = 0x0400 , IDNS_LocalExtern = 0x0800 , IDNS_OMPReduction = 0x1000 , IDNS_OMPMapper = 0x2000 } |
IdentifierNamespace - The different namespaces in which declarations may appear. More... | |
enum | ObjCDeclQualifier { OBJC_TQ_None = 0x0 , OBJC_TQ_In = 0x1 , OBJC_TQ_Inout = 0x2 , OBJC_TQ_Out = 0x4 , OBJC_TQ_Bycopy = 0x8 , OBJC_TQ_Byref = 0x10 , OBJC_TQ_Oneway = 0x20 , OBJC_TQ_CSNullability = 0x40 } |
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declarations. More... | |
enum class | ModuleOwnershipKind : unsigned char { Unowned , Visible , VisibleWhenImported , ReachableWhenImported , ModulePrivate } |
The kind of ownership a declaration has, for visibility purposes. More... | |
enum | FriendObjectKind { FOK_None , FOK_Declared , FOK_Undeclared } |
using | attr_iterator = AttrVec::const_iterator |
using | attr_range = llvm::iterator_range< attr_iterator > |
using | redecl_range = llvm::iterator_range< redecl_iterator > |
![]() | |
using | redecl_range = llvm::iterator_range< redecl_iterator > |
Public Member Functions | |
void | LoadLazySpecializations (bool OnlyPartial=false) const |
Load any lazily-loaded specializations from the external source. | |
CXXRecordDecl * | getTemplatedDecl () const |
Get the underlying class declarations of the template. | |
bool | isThisDeclarationADefinition () const |
Returns whether this template declaration defines the primary class pattern. | |
ClassTemplateSpecializationDecl * | findSpecialization (ArrayRef< TemplateArgument > Args, void *&InsertPos) |
Return the specialization with the provided arguments if it exists, otherwise return the insertion point. | |
void | AddSpecialization (ClassTemplateSpecializationDecl *D, void *InsertPos) |
Insert the specified specialization knowing that it is not already in. | |
ClassTemplateDecl * | getCanonicalDecl () override |
Retrieves the canonical declaration of this template. | |
const ClassTemplateDecl * | getCanonicalDecl () const |
ClassTemplateDecl * | getPreviousDecl () |
Retrieve the previous declaration of this class template, or nullptr if no such declaration exists. | |
const ClassTemplateDecl * | getPreviousDecl () const |
ClassTemplateDecl * | getMostRecentDecl () |
const ClassTemplateDecl * | getMostRecentDecl () const |
ClassTemplateDecl * | getInstantiatedFromMemberTemplate () const |
ClassTemplatePartialSpecializationDecl * | findPartialSpecialization (ArrayRef< TemplateArgument > Args, TemplateParameterList *TPL, void *&InsertPos) |
Return the partial specialization with the provided arguments if it exists, otherwise return the insertion point. | |
void | AddPartialSpecialization (ClassTemplatePartialSpecializationDecl *D, void *InsertPos) |
Insert the specified partial specialization knowing that it is not already in. | |
void | getPartialSpecializations (SmallVectorImpl< ClassTemplatePartialSpecializationDecl * > &PS) const |
Retrieve the partial specializations as an ordered list. | |
ClassTemplatePartialSpecializationDecl * | findPartialSpecialization (QualType T) |
Find a class template partial specialization with the given type T. | |
ClassTemplatePartialSpecializationDecl * | findPartialSpecInstantiatedFromMember (ClassTemplatePartialSpecializationDecl *D) |
Find a class template partial specialization which was instantiated from the given member partial specialization. | |
QualType | getInjectedClassNameSpecialization () |
Retrieve the template specialization type of the injected-class-name for this class template. | |
spec_range | specializations () const |
spec_iterator | spec_begin () const |
spec_iterator | spec_end () const |
![]() | |
RedeclarableTemplateDecl * | getCanonicalDecl () override |
Retrieves the canonical declaration of this template. | |
const RedeclarableTemplateDecl * | getCanonicalDecl () const |
bool | isMemberSpecialization () const |
Determines whether this template was a specialization of a member template. | |
void | setMemberSpecialization () |
Note that this member template is a specialization. | |
RedeclarableTemplateDecl * | getInstantiatedFromMemberTemplate () const |
Retrieve the member template from which this template was instantiated, or nullptr if this template was not instantiated from a member template. | |
void | setInstantiatedFromMemberTemplate (RedeclarableTemplateDecl *TD) |
ArrayRef< TemplateArgument > | getInjectedTemplateArgs (const ASTContext &Context) const |
Retrieve the "injected" template arguments that correspond to the template parameters of this template. | |
![]() | |
TemplateParameterList * | getTemplateParameters () const |
Get the list of template parameters. | |
void | getAssociatedConstraints (llvm::SmallVectorImpl< const Expr * > &AC) const |
Get the total constraint-expression associated with this template, including constraint-expressions derived from the requires-clause, trailing requires-clause (for functions and methods) and constrained template parameters. | |
bool | hasAssociatedConstraints () const |
NamedDecl * | getTemplatedDecl () const |
Get the underlying, templated declaration. | |
bool | isTypeAlias () const |
SourceRange | getSourceRange () const override LLVM_READONLY |
Source range that this declaration covers. | |
void | setTemplateParameters (TemplateParameterList *TParams) |
void | init (NamedDecl *NewTemplatedDecl) |
Initialize the underlying templated declaration. | |
![]() | |
IdentifierInfo * | getIdentifier () const |
Get the identifier that names this declaration, if there is one. | |
StringRef | getName () const |
Get the name of identifier for this declaration as a StringRef. | |
std::string | getNameAsString () const |
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ constructor, Objective-C selector, etc). | |
virtual void | printName (raw_ostream &OS, const PrintingPolicy &Policy) const |
Pretty-print the unqualified name of this declaration. | |
void | printName (raw_ostream &OS) const |
Calls printName() with the ASTContext printing policy from the decl. | |
DeclarationName | getDeclName () const |
Get the actual, stored name of the declaration, which may be a special name. | |
void | setDeclName (DeclarationName N) |
Set the name of this declaration. | |
void | printQualifiedName (raw_ostream &OS) const |
Returns a human-readable qualified name for this declaration, like A::B::i, for i being member of namespace A::B. | |
void | printQualifiedName (raw_ostream &OS, const PrintingPolicy &Policy) const |
void | printNestedNameSpecifier (raw_ostream &OS) const |
Print only the nested name specifier part of a fully-qualified name, including the '::' at the end. | |
void | printNestedNameSpecifier (raw_ostream &OS, const PrintingPolicy &Policy) const |
std::string | getQualifiedNameAsString () const |
virtual void | getNameForDiagnostic (raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const |
Appends a human-readable name for this declaration into the given stream. | |
bool | declarationReplaces (const NamedDecl *OldD, bool IsKnownNewer=true) const |
Determine whether this declaration, if known to be well-formed within its context, will replace the declaration OldD if introduced into scope. | |
bool | hasLinkage () const |
Determine whether this declaration has linkage. | |
bool | isCXXClassMember () const |
Determine whether this declaration is a C++ class member. | |
bool | isCXXInstanceMember () const |
Determine whether the given declaration is an instance member of a C++ class. | |
ReservedIdentifierStatus | isReserved (const LangOptions &LangOpts) const |
Determine if the declaration obeys the reserved identifier rules of the given language. | |
Linkage | getLinkageInternal () const |
Determine what kind of linkage this entity has. | |
Linkage | getFormalLinkage () const |
Get the linkage from a semantic point of view. | |
bool | hasExternalFormalLinkage () const |
True if this decl has external linkage. | |
bool | isExternallyVisible () const |
bool | isExternallyDeclarable () const |
Determine whether this declaration can be redeclared in a different translation unit. | |
Visibility | getVisibility () const |
Determines the visibility of this entity. | |
LinkageInfo | getLinkageAndVisibility () const |
Determines the linkage and visibility of this entity. | |
std::optional< Visibility > | getExplicitVisibility (ExplicitVisibilityKind kind) const |
If visibility was explicitly specified for this declaration, return that visibility. | |
bool | isLinkageValid () const |
True if the computed linkage is valid. | |
bool | hasLinkageBeenComputed () const |
True if something has required us to compute the linkage of this declaration. | |
bool | isPlaceholderVar (const LangOptions &LangOpts) const |
NamedDecl * | getUnderlyingDecl () |
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl. | |
const NamedDecl * | getUnderlyingDecl () const |
NamedDecl * | getMostRecentDecl () |
const NamedDecl * | getMostRecentDecl () const |
ObjCStringFormatFamily | getObjCFStringFormattingFamily () const |
bool | isModulePrivate () const |
Whether this declaration was marked as being private to the module in which it was defined. | |
void | setModulePrivate () |
Specify that this declaration was marked as being private to the module in which it was defined. | |
![]() | |
Decl ()=delete | |
Decl (const Decl &)=delete | |
Decl (Decl &&)=delete | |
Decl & | operator= (const Decl &)=delete |
Decl & | operator= (Decl &&)=delete |
virtual SourceRange | getSourceRange () const LLVM_READONLY |
Source range that this declaration covers. | |
SourceLocation | getBeginLoc () const LLVM_READONLY |
SourceLocation | getEndLoc () const LLVM_READONLY |
SourceLocation | getLocation () const |
void | setLocation (SourceLocation L) |
Kind | getKind () const |
const char * | getDeclKindName () const |
Decl * | getNextDeclInContext () |
const Decl * | getNextDeclInContext () const |
DeclContext * | getDeclContext () |
const DeclContext * | getDeclContext () const |
DeclContext * | getNonTransparentDeclContext () |
Return the non transparent context. | |
const DeclContext * | getNonTransparentDeclContext () const |
Decl * | getNonClosureContext () |
Find the innermost non-closure ancestor of this declaration, walking up through blocks, lambdas, etc. | |
const Decl * | getNonClosureContext () const |
TranslationUnitDecl * | getTranslationUnitDecl () |
const TranslationUnitDecl * | getTranslationUnitDecl () const |
bool | isInAnonymousNamespace () const |
bool | isInStdNamespace () const |
bool | isFileContextDecl () const |
ASTContext & | getASTContext () const LLVM_READONLY |
const LangOptions & | getLangOpts () const LLVM_READONLY |
Helper to get the language options from the ASTContext. | |
void | setAccess (AccessSpecifier AS) |
AccessSpecifier | getAccess () const |
AccessSpecifier | getAccessUnsafe () const |
Retrieve the access specifier for this declaration, even though it may not yet have been properly set. | |
bool | hasAttrs () const |
void | setAttrs (const AttrVec &Attrs) |
AttrVec & | getAttrs () |
const AttrVec & | getAttrs () const |
void | dropAttrs () |
void | addAttr (Attr *A) |
attr_range | attrs () const |
attr_iterator | attr_begin () const |
attr_iterator | attr_end () const |
template<typename... Ts> | |
void | dropAttrs () |
template<typename T > | |
void | dropAttr () |
template<typename T > | |
llvm::iterator_range< specific_attr_iterator< T > > | specific_attrs () const |
template<typename T > | |
specific_attr_iterator< T > |