class TemplateArgument
Declaration
class TemplateArgument { /* full declaration omitted */ };
Description
Represents a template argument.
Declared at: clang/include/clang/AST/TemplateBase.h:61
Member Variables
- private anonymous struct / union
Method Overview
- public static clang::TemplateArgument CreatePackCopy(clang::ASTContext & Context, ArrayRef<clang::TemplateArgument> Args)
- public void Profile(llvm::FoldingSetNodeID & ID, const clang::ASTContext & Context) const
- public TemplateArgument(clang::QualType T, bool isNullPtr = false)
- public TemplateArgument(clang::TemplateName, bool)
- public TemplateArgument(ArrayRef<clang::TemplateArgument> Args)
- public TemplateArgument(clang::Expr * E)
- public TemplateArgument(clang::TemplateName Name)
- public constexpr TemplateArgument()
- public TemplateArgument(clang::ValueDecl * D, clang::QualType QT)
- public TemplateArgument(clang::ASTContext & Ctx, const llvm::APSInt & Value, clang::QualType Type)
- public TemplateArgument(const clang::TemplateArgument & Other, clang::QualType Type)
- public TemplateArgument(clang::TemplateName Name, Optional<unsigned int> NumExpansions)
- public bool containsUnexpandedParameterPack() const
- public void dump() const
- public void dump(llvm::raw_ostream & Out) const
- public clang::ValueDecl * getAsDecl() const
- public clang::Expr * getAsExpr() const
- public llvm::APSInt getAsIntegral() const
- public clang::TemplateName getAsTemplate() const
- public clang::TemplateName getAsTemplateOrTemplatePattern() const
- public clang::QualType getAsType() const
- public clang::TemplateArgumentDependence getDependence() const
- public static clang::TemplateArgument getEmptyPack()
- public clang::QualType getIntegralType() const
- public clang::TemplateArgument::ArgKind getKind() const
- public clang::QualType getNonTypeTemplateArgumentType() const
- public clang::QualType getNullPtrType() const
- public Optional<unsigned int> getNumTemplateExpansions() const
- public ArrayRef<clang::TemplateArgument> getPackAsArray() const
- public clang::TemplateArgument getPackExpansionPattern() const
- public clang::QualType getParamTypeForDecl() const
- public bool isDependent() const
- public bool isInstantiationDependent() const
- public bool isNull() const
- public bool isPackExpansion() const
- public clang::TemplateArgument::pack_iterator pack_begin() const
- public ArrayRef<clang::TemplateArgument> pack_elements() const
- public clang::TemplateArgument::pack_iterator pack_end() const
- public unsigned int pack_size() const
- public void print(const clang::PrintingPolicy & Policy, llvm::raw_ostream & Out, bool IncludeType) const
- public void setIntegralType(clang::QualType T)
- public bool structurallyEquals(const clang::TemplateArgument & Other) const
Methods
¶static clang::TemplateArgument CreatePackCopy(
clang::ASTContext& Context,
ArrayRef<clang::TemplateArgument> Args)
static clang::TemplateArgument CreatePackCopy(
clang::ASTContext& Context,
ArrayRef<clang::TemplateArgument> Args)
Description
Create a new template argument pack by copying the given set of template arguments.
Declared at: clang/include/clang/AST/TemplateBase.h:240
Parameters
- clang::ASTContext& Context
- ArrayRef<clang::TemplateArgument> Args
¶void Profile(
llvm::FoldingSetNodeID& ID,
const clang::ASTContext& Context) const
void Profile(
llvm::FoldingSetNodeID& ID,
const clang::ASTContext& Context) const
Description
Used to insert TemplateArguments into FoldingSets.
Declared at: clang/include/clang/AST/TemplateBase.h:401
Parameters
- llvm::FoldingSetNodeID& ID
- const clang::ASTContext& Context
¶TemplateArgument(clang::QualType T,
bool isNullPtr = false)
TemplateArgument(clang::QualType T,
bool isNullPtr = false)
Description
Construct a template type argument.
Declared at: clang/include/clang/AST/TemplateBase.h:154
Parameters
- clang::QualType T
- bool isNullPtr = false
¶TemplateArgument(clang::TemplateName, bool)
TemplateArgument(clang::TemplateName, bool)
Declared at: clang/include/clang/AST/TemplateBase.h:234
Parameters
- clang::TemplateName
- bool
¶TemplateArgument(
ArrayRef<clang::TemplateArgument> Args)
TemplateArgument(
ArrayRef<clang::TemplateArgument> Args)
Description
Construct a template argument that is a template argument pack. We assume that storage for the template arguments provided outlives the TemplateArgument itself.
Declared at: clang/include/clang/AST/TemplateBase.h:228
Parameters
- ArrayRef<clang::TemplateArgument> Args
¶TemplateArgument(clang::Expr* E)
TemplateArgument(clang::Expr* E)
Description
Construct a template argument that is an expression. This form of template argument only occurs in template argument lists used for dependent types and for expression; it will not occur in a non-dependent, canonical template argument list.
Declared at: clang/include/clang/AST/TemplateBase.h:219
Parameters
- clang::Expr* E
¶TemplateArgument(clang::TemplateName Name)
TemplateArgument(clang::TemplateName Name)
Description
Construct a template argument that is a template. This form of template argument is generally used for template template parameters. However, the template name could be a dependent template name that ends up being instantiated to a function template whose address is taken.
Declared at: clang/include/clang/AST/TemplateBase.h:188
Parameters
- clang::TemplateName Name
- The template name.
¶constexpr TemplateArgument()
constexpr TemplateArgument()
Description
Construct an empty, invalid template argument.
Declared at: clang/include/clang/AST/TemplateBase.h:151
¶TemplateArgument(clang::ValueDecl* D,
clang::QualType QT)
TemplateArgument(clang::ValueDecl* D,
clang::QualType QT)
Description
Construct a template argument that refers to a declaration, which is either an external declaration or a template declaration.
Declared at: clang/include/clang/AST/TemplateBase.h:162
Parameters
¶TemplateArgument(clang::ASTContext& Ctx,
const llvm::APSInt& Value,
clang::QualType Type)
TemplateArgument(clang::ASTContext& Ctx,
const llvm::APSInt& Value,
clang::QualType Type)
Description
Construct an integral constant template argument. The memory to store the value is allocated with Ctx.
Declared at: clang/include/clang/AST/TemplateBase.h:171
Parameters
- clang::ASTContext& Ctx
- const llvm::APSInt& Value
- clang::QualType Type
¶TemplateArgument(
const clang::TemplateArgument& Other,
clang::QualType Type)
TemplateArgument(
const clang::TemplateArgument& Other,
clang::QualType Type)
Description
Construct an integral constant template argument with the same value as Other but a different type.
Declared at: clang/include/clang/AST/TemplateBase.h:175
Parameters
- const clang::TemplateArgument& Other
- clang::QualType Type
¶TemplateArgument(
clang::TemplateName Name,
Optional<unsigned int> NumExpansions)
TemplateArgument(
clang::TemplateName Name,
Optional<unsigned int> NumExpansions)
Description
Construct a template argument that is a template pack expansion. This form of template argument is generally used for template template parameters. However, the template name could be a dependent template name that ends up being instantiated to a function template whose address is taken.
Declared at: clang/include/clang/AST/TemplateBase.h:205
Parameters
- clang::TemplateName Name
- The template name.
- Optional<unsigned int> NumExpansions
- The number of expansions that will be generated by instantiating
¶bool containsUnexpandedParameterPack() const
bool containsUnexpandedParameterPack() const
Description
Whether this template argument contains an unexpanded parameter pack.
Declared at: clang/include/clang/AST/TemplateBase.h:262
¶void dump() const
void dump() const
Description
Debugging aid that dumps the template argument to standard error.
Declared at: clang/include/clang/AST/TemplateBase.h:398
¶void dump(llvm::raw_ostream& Out) const
void dump(llvm::raw_ostream& Out) const
Description
Debugging aid that dumps the template argument.
Declared at: clang/include/clang/AST/TemplateBase.h:395
Parameters
- llvm::raw_ostream& Out
¶clang::ValueDecl* getAsDecl() const
clang::ValueDecl* getAsDecl() const
Description
Retrieve the declaration for a declaration non-type template argument.
Declared at: clang/include/clang/AST/TemplateBase.h:275
¶clang::Expr* getAsExpr() const
clang::Expr* getAsExpr() const
Description
Retrieve the template argument as an expression.
Declared at: clang/include/clang/AST/TemplateBase.h:341
¶llvm::APSInt getAsIntegral() const
llvm::APSInt getAsIntegral() const
Description
Retrieve the template argument as an integral value.
Declared at: clang/include/clang/AST/TemplateBase.h:312
¶clang::TemplateName getAsTemplate() const
clang::TemplateName getAsTemplate() const
Description
Retrieve the template name for a template name argument.
Declared at: clang/include/clang/AST/TemplateBase.h:292
¶clang::TemplateName
getAsTemplateOrTemplatePattern() const
clang::TemplateName
getAsTemplateOrTemplatePattern() const
Description
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Declared at: clang/include/clang/AST/TemplateBase.h:299
¶clang::QualType getAsType() const
clang::QualType getAsType() const
Description
Retrieve the type for a type template argument.
Declared at: clang/include/clang/AST/TemplateBase.h:268
¶clang::TemplateArgumentDependence getDependence()
const
clang::TemplateArgumentDependence getDependence()
const
Declared at: clang/include/clang/AST/TemplateBase.h:249
¶static clang::TemplateArgument getEmptyPack()
static clang::TemplateArgument getEmptyPack()
Declared at: clang/include/clang/AST/TemplateBase.h:236
¶clang::QualType getIntegralType() const
clang::QualType getIntegralType() const
Description
Retrieve the type of the integral value.
Declared at: clang/include/clang/AST/TemplateBase.h:326
¶clang::TemplateArgument::ArgKind getKind() const
clang::TemplateArgument::ArgKind getKind() const
Description
Return the kind of stored template argument.
Declared at: clang/include/clang/AST/TemplateBase.h:244
¶clang::QualType getNonTypeTemplateArgumentType()
const
clang::QualType getNonTypeTemplateArgumentType()
const
Description
If this is a non-type template argument, get its type. Otherwise, returns a null QualType.
Declared at: clang/include/clang/AST/TemplateBase.h:338
¶clang::QualType getNullPtrType() const
clang::QualType getNullPtrType() const
Description
Retrieve the type for null non-type template argument.
Declared at: clang/include/clang/AST/TemplateBase.h:286
¶Optional<unsigned int> getNumTemplateExpansions()
const
Optional<unsigned int> getNumTemplateExpansions()
const
Description
Retrieve the number of expansions that a template template argument expansion will produce, if known.
Declared at: clang/include/clang/AST/TemplateBase.h:308
¶ArrayRef<clang::TemplateArgument> getPackAsArray()
const
ArrayRef<clang::TemplateArgument> getPackAsArray()
const
Description
Return the array of arguments in this template argument pack.
Declared at: clang/include/clang/AST/TemplateBase.h:377
¶clang::TemplateArgument getPackExpansionPattern()
const
clang::TemplateArgument getPackExpansionPattern()
const
Description
When the template argument is a pack expansion, returns the pattern of the pack expansion.
Declared at: clang/include/clang/AST/TemplateBase.h:388
¶clang::QualType getParamTypeForDecl() const
clang::QualType getParamTypeForDecl() const
Declared at: clang/include/clang/AST/TemplateBase.h:280
¶bool isDependent() const
bool isDependent() const
Description
Whether this template argument is dependent on a template parameter such that its result can change from one instantiation to another.
Declared at: clang/include/clang/AST/TemplateBase.h:254
¶bool isInstantiationDependent() const
bool isInstantiationDependent() const
Description
Whether this template argument is dependent on a template parameter.
Declared at: clang/include/clang/AST/TemplateBase.h:258
¶bool isNull() const
bool isNull() const
Description
Determine whether this template argument has no value.
Declared at: clang/include/clang/AST/TemplateBase.h:247
¶bool isPackExpansion() const
bool isPackExpansion() const
Description
Determine whether this template argument is a pack expansion.
Declared at: clang/include/clang/AST/TemplateBase.h:265
¶clang::TemplateArgument::pack_iterator
pack_begin() const
clang::TemplateArgument::pack_iterator
pack_begin() const
Description
Iterator referencing the first argument of a template argument pack.
Declared at: clang/include/clang/AST/TemplateBase.h:351
¶ArrayRef<clang::TemplateArgument> pack_elements()
const
ArrayRef<clang::TemplateArgument> pack_elements()
const
Description
Iterator range referencing all of the elements of a template argument pack.
Declared at: clang/include/clang/AST/TemplateBase.h:365
¶clang::TemplateArgument::pack_iterator pack_end()
const
clang::TemplateArgument::pack_iterator pack_end()
const
Description
Iterator referencing one past the last argument of a template argument pack.
Declared at: clang/include/clang/AST/TemplateBase.h:358
¶unsigned int pack_size() const
unsigned int pack_size() const
Description
The number of template arguments in the given template argument pack.
Declared at: clang/include/clang/AST/TemplateBase.h:371
¶void print(const clang::PrintingPolicy& Policy,
llvm::raw_ostream& Out,
bool IncludeType) const
void print(const clang::PrintingPolicy& Policy,
llvm::raw_ostream& Out,
bool IncludeType) const
Description
Print this template argument to the given output stream.
Declared at: clang/include/clang/AST/TemplateBase.h:391
Parameters
- const clang::PrintingPolicy& Policy
- llvm::raw_ostream& Out
- bool IncludeType
¶void setIntegralType(clang::QualType T)
void setIntegralType(clang::QualType T)
Declared at: clang/include/clang/AST/TemplateBase.h:331
Parameters
¶bool structurallyEquals(
const clang::TemplateArgument& Other) const
bool structurallyEquals(
const clang::TemplateArgument& Other) const
Description
Determines whether two template arguments are superficially the same.
Declared at: clang/include/clang/AST/TemplateBase.h:384
Parameters
- const clang::TemplateArgument& Other