clang API Documentation
The base class of all kinds of template declarations (e.g., class, function, etc.). More...
#include <DeclTemplate.h>
Public Member Functions | |
TemplateParameterList * | getTemplateParameters () const |
Get the list of template parameters. | |
NamedDecl * | getTemplatedDecl () const |
Get the underlying, templated declaration. | |
SourceRange | getSourceRange () const override LLVM_READONLY |
Source range that this declaration covers. | |
void | init (NamedDecl *templatedDecl, TemplateParameterList *templateParams) |
Initialize the underlying templated declaration and template parameters. | |
Static Public Member Functions | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Protected Member Functions | |
TemplateDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName Name) | |
TemplateDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params) | |
TemplateDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl) | |
Protected Attributes | |
NamedDecl * | TemplatedDecl |
TemplateParameterList * | TemplateParams |
The base class of all kinds of template declarations (e.g., class, function, etc.).
The TemplateDecl class stores the list of template parameters and a reference to the templated scoped declaration: the underlying AST node.
Definition at line 229 of file DeclTemplate.h.
clang::TemplateDecl::TemplateDecl | ( | Kind | DK, |
DeclContext * | DC, | ||
SourceLocation | L, | ||
DeclarationName | Name | ||
) | [inline, protected] |
Definition at line 233 of file DeclTemplate.h.
clang::TemplateDecl::TemplateDecl | ( | Kind | DK, |
DeclContext * | DC, | ||
SourceLocation | L, | ||
DeclarationName | Name, | ||
TemplateParameterList * | Params | ||
) | [inline, protected] |
Definition at line 240 of file DeclTemplate.h.
clang::TemplateDecl::TemplateDecl | ( | Kind | DK, |
DeclContext * | DC, | ||
SourceLocation | L, | ||
DeclarationName | Name, | ||
TemplateParameterList * | Params, | ||
NamedDecl * | Decl | ||
) | [inline, protected] |
Definition at line 246 of file DeclTemplate.h.
static bool clang::TemplateDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::NamedDecl.
Reimplemented in clang::VarTemplateDecl, clang::TypeAliasTemplateDecl, clang::ClassTemplateDecl, clang::TemplateTemplateParmDecl, clang::FunctionTemplateDecl, and clang::RedeclarableTemplateDecl.
Definition at line 261 of file DeclTemplate.h.
References classofKind(), and clang::Decl::getKind().
static bool clang::TemplateDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::NamedDecl.
Reimplemented in clang::VarTemplateDecl, clang::TypeAliasTemplateDecl, clang::ClassTemplateDecl, clang::TemplateTemplateParmDecl, clang::FunctionTemplateDecl, and clang::RedeclarableTemplateDecl.
Definition at line 262 of file DeclTemplate.h.
Referenced by classof().
SourceRange clang::TemplateDecl::getSourceRange | ( | ) | const [inline, override, virtual] |
Source range that this declaration covers.
Reimplemented from clang::Decl.
Reimplemented in clang::TemplateTemplateParmDecl.
Definition at line 266 of file DeclTemplate.h.
References clang::SourceRange::getEnd(), clang::Decl::getSourceRange(), clang::TemplateParameterList::getTemplateLoc(), TemplatedDecl, and TemplateParams.
Referenced by clang::Sema::FinishTemplateArgumentDeduction(), and clang::ClassTemplateSpecializationDecl::getSourceRange().
NamedDecl* clang::TemplateDecl::getTemplatedDecl | ( | ) | const [inline] |
Get the underlying, templated declaration.
Reimplemented in clang::VarTemplateDecl, clang::TypeAliasTemplateDecl, clang::ClassTemplateDecl, and clang::FunctionTemplateDecl.
Definition at line 258 of file DeclTemplate.h.
References TemplatedDecl.
Referenced by clang::Sema::ActOnExplicitInstantiation(), isSameEntity(), clang::ASTDeclReader::mergeTemplatePattern(), and clang::ASTDeclWriter::VisitTemplateDecl().
TemplateParameterList* clang::TemplateDecl::getTemplateParameters | ( | ) | const [inline] |
Get the list of template parameters.
Definition at line 253 of file DeclTemplate.h.
References TemplateParams.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), addFunctionPointerConversion(), AddTemplateParameterChunks(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateArgumentList(), clang::PredefinedExpr::ComputeName(), clang::Sema::DeduceTemplateArguments(), diagnoseArityMismatch(), DiagnoseUnexpandedParameterPacks(), clang::comments::DeclInfo::fill(), FinishTemplateArgumentDeduction(), clang::Sema::FinishTemplateArgumentDeduction(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::FunctionTemplateDecl::getInjectedTemplateArgs(), getLVForTemplateParameterList(), clang::TemplateTemplateParmDecl::getSourceRange(), hasDeducibleTemplateParameters(), isAtLeastAsSpecializedAs(), clang::Sema::IsOverload(), clang::TemplateTemplateParmDecl::isPackExpansion(), isSameEntity(), isSameTemplateParameter(), clang::Sema::isStdInitializerList(), IsStructurallyEquivalent(), LookupStdInitializerList(), clang::Sema::MarkDeducedTemplateParameters(), MatchTemplateParameterKind(), mergeTemplateLV(), clang::Sema::MergeVarDecl(), clang::Sema::PrintInstantiationStack(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTDeclWriter::VisitTemplateDecl(), clang::ASTNodeImporter::VisitTemplateTemplateParmDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
void clang::TemplateDecl::init | ( | NamedDecl * | templatedDecl, |
TemplateParameterList * | templateParams | ||
) | [inline] |
Initialize the underlying templated declaration and template parameters.
Definition at line 278 of file DeclTemplate.h.
References TemplatedDecl, and TemplateParams.
Referenced by clang::ASTDeclReader::VisitTemplateDecl().
NamedDecl* clang::TemplateDecl::TemplatedDecl [protected] |
Definition at line 272 of file DeclTemplate.h.
Referenced by getSourceRange(), getTemplatedDecl(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::TypeAliasTemplateDecl::getTemplatedDecl(), clang::VarTemplateDecl::getTemplatedDecl(), and init().
TemplateParameterList* clang::TemplateDecl::TemplateParams [protected] |
Definition at line 273 of file DeclTemplate.h.
Referenced by getSourceRange(), getTemplateParameters(), and init().