clang API Documentation
Represents a template argument. More...
#include <TemplateBase.h>
Classes | |
struct | A |
struct | DA |
The kind of template argument we're storing. | |
struct | I |
struct | TA |
struct | TV |
Public Types | |
enum | ArgKind { Null = 0, Type, Declaration, NullPtr, Integral, Template, TemplateExpansion, Expression, Pack } |
The kind of template argument we're storing. More... | |
typedef const TemplateArgument * | pack_iterator |
Iterator that traverses the elements of a template argument pack. | |
Public Member Functions | |
TemplateArgument () | |
Construct an empty, invalid template argument. | |
TemplateArgument (QualType T, bool isNullPtr=false) | |
Construct a template type argument. | |
TemplateArgument (ValueDecl *D, QualType QT) | |
Construct a template argument that refers to a declaration, which is either an external declaration or a template declaration. | |
TemplateArgument (ASTContext &Ctx, const llvm::APSInt &Value, QualType Type) | |
Construct an integral constant template argument. The memory to store the value is allocated with Ctx. | |
TemplateArgument (const TemplateArgument &Other, QualType Type) | |
Construct an integral constant template argument with the same value as Other but a different type. | |
TemplateArgument (TemplateName Name) | |
Construct a template argument that is a template. | |
TemplateArgument (TemplateName Name, Optional< unsigned > NumExpansions) | |
Construct a template argument that is a template pack expansion. | |
TemplateArgument (Expr *E) | |
Construct a template argument that is an expression. | |
TemplateArgument (const TemplateArgument *Args, unsigned NumArgs) | |
Construct a template argument that is a template argument pack. | |
ArgKind | getKind () const |
Return the kind of stored template argument. | |
bool | isNull () const |
Determine whether this template argument has no value. | |
bool | isDependent () const |
Whether this template argument is dependent on a template parameter such that its result can change from one instantiation to another. | |
bool | isInstantiationDependent () const |
Whether this template argument is dependent on a template parameter. | |
bool | containsUnexpandedParameterPack () const |
Whether this template argument contains an unexpanded parameter pack. | |
bool | isPackExpansion () const |
Determine whether this template argument is a pack expansion. | |
QualType | getAsType () const |
Retrieve the type for a type template argument. | |
ValueDecl * | getAsDecl () const |
Retrieve the declaration for a declaration non-type template argument. | |
QualType | getParamTypeForDecl () const |
QualType | getNullPtrType () const |
Retrieve the type for null non-type template argument. | |
TemplateName | getAsTemplate () const |
Retrieve the template name for a template name argument. | |
TemplateName | getAsTemplateOrTemplatePattern () const |
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name. | |
Optional< unsigned > | getNumTemplateExpansions () const |
Retrieve the number of expansions that a template template argument expansion will produce, if known. | |
llvm::APSInt | getAsIntegral () const |
Retrieve the template argument as an integral value. | |
QualType | getIntegralType () const |
Retrieve the type of the integral value. | |
void | setIntegralType (QualType T) |
Expr * | getAsExpr () const |
Retrieve the template argument as an expression. | |
pack_iterator | pack_begin () const |
Iterator referencing the first argument of a template argument pack. | |
pack_iterator | pack_end () const |
Iterator referencing one past the last argument of a template argument pack. | |
llvm::iterator_range < pack_iterator > | pack_elements () const |
Iterator range referencing all of the elements of a template argument pack. | |
unsigned | pack_size () const |
The number of template arguments in the given template argument pack. | |
ArrayRef< TemplateArgument > | getPackAsArray () const |
Return the array of arguments in this template argument pack. | |
bool | structurallyEquals (const TemplateArgument &Other) const |
Determines whether two template arguments are superficially the same. | |
TemplateArgument | getPackExpansionPattern () const |
When the template argument is a pack expansion, returns the pattern of the pack expansion. | |
void | print (const PrintingPolicy &Policy, raw_ostream &Out) const |
Print this template argument to the given output stream. | |
void | Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context) const |
Used to insert TemplateArguments into FoldingSets. | |
Static Public Member Functions | |
static TemplateArgument | getEmptyPack () |
static TemplateArgument | CreatePackCopy (ASTContext &Context, const TemplateArgument *Args, unsigned NumArgs) |
Create a new template argument pack by copying the given set of template arguments. |
Represents a template argument.
Definition at line 39 of file TemplateBase.h.
typedef const TemplateArgument* clang::TemplateArgument::pack_iterator |
Iterator that traverses the elements of a template argument pack.
Definition at line 313 of file TemplateBase.h.
The kind of template argument we're storing.
Null |
Represents an empty template argument, e.g., one that has not been deduced. |
Type |
The template argument is a type. |
Declaration |
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter. |
NullPtr |
The template argument is a null pointer or null pointer to member that was provided for a non-type template parameter. |
Integral |
The template argument is an integral value stored in an llvm::APSInt that was provided for an integral non-type template parameter. |
Template |
The template argument is a template name that was provided for a template template parameter. |
TemplateExpansion |
The template argument is a pack expansion of a template name that was provided for a template template parameter. |
Expression |
The template argument is an expression, and we've not resolved it to one of the other forms yet, either because it's dependent or because we're representing a non-canonical template argument (for instance, in a TemplateSpecializationType). Also used to represent a non-dependent __uuidof expression (a Microsoft extension). |
Pack |
The template argument is actually a parameter pack. Arguments are stored in the Args struct. |
Definition at line 42 of file TemplateBase.h.
clang::TemplateArgument::TemplateArgument | ( | ) | [inline] |
Construct an empty, invalid template argument.
Definition at line 121 of file TemplateBase.h.
References Null, and TypeOrValue.
Referenced by CreatePackCopy(), getEmptyPack(), and getPackExpansionPattern().
Construct a template type argument.
Definition at line 127 of file TemplateBase.h.
References clang::QualType::getAsOpaquePtr(), NullPtr, Type, and TypeOrValue.
Construct a template argument that refers to a declaration, which is either an external declaration or a template declaration.
Definition at line 135 of file TemplateBase.h.
References Declaration, DeclArg, and clang::QualType::getAsOpaquePtr().
TemplateArgument::TemplateArgument | ( | ASTContext & | Ctx, |
const llvm::APSInt & | Value, | ||
QualType | Type | ||
) |
Construct an integral constant template argument. The memory to store the value is allocated with Ctx.
Definition at line 57 of file TemplateBase.cpp.
References clang::ASTContext::Allocate(), clang::QualType::getAsOpaquePtr(), Integer, and Integral.
clang::TemplateArgument::TemplateArgument | ( | const TemplateArgument & | Other, |
QualType | Type | ||
) | [inline] |
Construct an integral constant template argument with the same value as Other but a different type.
Definition at line 148 of file TemplateBase.h.
References clang::QualType::getAsOpaquePtr(), and Integer.
clang::TemplateArgument::TemplateArgument | ( | TemplateName | Name | ) | [inline] |
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.
Name | The template name. |
Definition at line 161 of file TemplateBase.h.
References clang::TemplateName::getAsVoidPointer(), Template, and TemplateArg.
clang::TemplateArgument::TemplateArgument | ( | TemplateName | Name, |
Optional< unsigned > | NumExpansions | ||
) | [inline] |
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.
Name | The template name. |
NumExpansions | The number of expansions that will be generated by instantiating |
Definition at line 178 of file TemplateBase.h.
References clang::TemplateName::getAsVoidPointer(), TemplateArg, and TemplateExpansion.
clang::TemplateArgument::TemplateArgument | ( | Expr * | E | ) | [inline] |
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.
Definition at line 192 of file TemplateBase.h.
References Expression, and TypeOrValue.
clang::TemplateArgument::TemplateArgument | ( | const TemplateArgument * | Args, |
unsigned | NumArgs | ||
) | [inline] |
Construct a template argument that is a template argument pack.
We assume that storage for the template arguments provided outlives the TemplateArgument itself.
Definition at line 201 of file TemplateBase.h.
Whether this template argument contains an unexpanded parameter pack.
Definition at line 190 of file TemplateBase.cpp.
References Declaration, Expression, getAsExpr(), getAsTemplate(), getAsType(), getKind(), Integral, Null, NullPtr, P, Pack, pack_elements(), Template, and TemplateExpansion.
Referenced by clang::Sema::DiagnoseUnexpandedParameterPack(), and clang::TreeTransform< Derived >::TransformTemplateArguments().
TemplateArgument TemplateArgument::CreatePackCopy | ( | ASTContext & | Context, |
const TemplateArgument * | Args, | ||
unsigned | NumArgs | ||
) | [static] |
Create a new template argument pack by copying the given set of template arguments.
Definition at line 76 of file TemplateBase.cpp.
References Context, getEmptyPack(), and TemplateArgument().
Referenced by clang::Sema::CheckTemplateArgumentList(), ConvertDeducedTemplateArgument(), and GenerateInjectedTemplateArgs().
ValueDecl* clang::TemplateArgument::getAsDecl | ( | ) | const [inline] |
Retrieve the declaration for a declaration non-type template argument.
Definition at line 247 of file TemplateBase.h.
References Declaration, DeclArg, and getKind().
Referenced by clang::ASTWriter::AddTemplateArgument(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), clang::ASTNodeImporter::ImportTemplateArgument(), isDependent(), isInstantiationDependent(), isSameTemplateArg(), IsStructurallyEquivalent(), clang::operator<<(), print(), Profile(), and structurallyEquals().
Expr* clang::TemplateArgument::getAsExpr | ( | ) | const [inline] |
Retrieve the template argument as an expression.
Definition at line 307 of file TemplateBase.h.
References Expression, getKind(), and TypeOrValue.
Referenced by clang::ASTWriter::AddTemplateArgument(), clang::ASTWriter::AddTemplateArgumentLoc(), checkDeducedTemplateArguments(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), containsUnexpandedParameterPack(), DeduceTemplateArguments(), getPackExpansionPattern(), clang::Sema::getTemplateArgumentPackExpansionPattern(), getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::TreeTransform< Derived >::InventTemplateArgumentLoc(), isDependent(), isInstantiationDependent(), isPackExpansion(), isSameTemplateArg(), IsStructurallyEquivalent(), isTemplateArgumentTemplateParameter(), MarkUsedTemplateParameters(), clang::operator<<(), print(), Profile(), clang::ASTReader::ReadTemplateArgumentLoc(), clang::TreeTransform< Derived >::TransformTemplateArgument(), and clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument().
llvm::APSInt clang::TemplateArgument::getAsIntegral | ( | ) | const [inline] |
Retrieve the template argument as an integral value.
Definition at line 284 of file TemplateBase.h.
References getKind(), Integer, and Integral.
Referenced by clang::ASTWriter::AddTemplateArgument(), clang::Sema::BuildExpressionFromIntegralTemplateArgument(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), isSameTemplateArg(), IsStructurallyEquivalent(), clang::operator<<(), printIntegral(), Profile(), and structurallyEquals().
TemplateName clang::TemplateArgument::getAsTemplate | ( | ) | const [inline] |
Retrieve the template name for a template name argument.
Definition at line 264 of file TemplateBase.h.
References clang::TemplateName::getFromVoidPointer(), getKind(), Template, and TemplateArg.
Referenced by clang::Sema::ActOnTemplateTemplateParameter(), checkDeducedTemplateArguments(), clang::Sema::CheckTemplateTypeArgument(), containsUnexpandedParameterPack(), DeduceTemplateArguments(), DiagnoseBadDeduction(), clang::ASTContext::getCanonicalTemplateArgument(), getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::TreeTransform< Derived >::InventTemplateArgumentLoc(), isDependent(), isInstantiationDependent(), IsStructurallyEquivalent(), clang::operator<<(), print(), clang::TreeTransform< Derived >::RebuildPackExpansion(), SubstDefaultTemplateArgument(), and clang::TreeTransform< Derived >::TransformTemplateArgument().
TemplateName clang::TemplateArgument::getAsTemplateOrTemplatePattern | ( | ) | const [inline] |
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Definition at line 271 of file TemplateBase.h.
References clang::TemplateName::getFromVoidPointer(), getKind(), Template, TemplateArg, and TemplateExpansion.
Referenced by addAssociatedClassesAndNamespaces(), clang::ASTWriter::AddTemplateArgument(), checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgument(), clang::ASTContext::getCanonicalTemplateArgument(), getPackExpansionPattern(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::TemplateSpecializationTypeLoc::initializeArgLocs(), isSameTemplateArg(), IsStructurallyEquivalent(), isTemplateArgumentTemplateParameter(), MarkUsedTemplateParameters(), clang::operator<<(), print(), Profile(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), and clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc().
QualType clang::TemplateArgument::getAsType | ( | ) | const [inline] |
Retrieve the type for a type template argument.
Definition at line 240 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), and TypeOrValue.
Referenced by addAssociatedClassesAndNamespaces(), clang::ASTWriter::AddTemplateArgument(), checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), containsUnexpandedParameterPack(), DeduceTemplateArguments(), DiagnoseBadDeduction(), clang::ASTContext::getCanonicalTemplateArgument(), getPackExpansionPattern(), clang::Sema::getTemplateArgumentPackExpansionPattern(), getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::TemplateSpecializationTypeLoc::initializeArgLocs(), clang::TreeTransform< Derived >::InventTemplateArgumentLoc(), isDependent(), isInstantiationDependent(), isPackExpansion(), isSameTemplateArg(), clang::Sema::isStdInitializerList(), IsStructurallyEquivalent(), isTemplateArgumentTemplateParameter(), MarkUsedTemplateParameters(), clang::operator<<(), print(), Profile(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), and clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc().
static TemplateArgument clang::TemplateArgument::getEmptyPack | ( | ) | [inline, static] |
Definition at line 207 of file TemplateBase.h.
References TemplateArgument().
Referenced by CreatePackCopy(), PackDeductionScope::finish(), and clang::Sema::FinishTemplateArgumentDeduction().
QualType clang::TemplateArgument::getIntegralType | ( | ) | const [inline] |
Retrieve the type of the integral value.
Definition at line 296 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), Integer, and Integral.
Referenced by clang::ASTWriter::AddTemplateArgument(), clang::Sema::BuildExpressionFromIntegralTemplateArgument(), DeduceTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), clang::ASTNodeImporter::ImportTemplateArgument(), IsStructurallyEquivalent(), printIntegral(), Profile(), and structurallyEquals().
ArgKind clang::TemplateArgument::getKind | ( | ) | const [inline] |
Return the kind of stored template argument.
Definition at line 218 of file TemplateBase.h.
References TypeOrValue.
Referenced by addAssociatedClassesAndNamespaces(), clang::ASTWriter::AddTemplateArgument(), clang::ASTWriter::AddTemplateArgumentLoc(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildExpressionFromIntegralTemplateArgument(), checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), containsUnexpandedParameterPack(), ConvertDeducedTemplateArgument(), DeduceTemplateArguments(), DiagnoseBadDeduction(), clang::comments::DeclInfo::fill(), getAsDecl(), getAsExpr(), getAsIntegral(), getAsTemplate(), getAsTemplateOrTemplatePattern(), getAsType(), clang::ASTContext::getCanonicalTemplateArgument(), getIntegralType(), clang::TemplateArgumentLoc::getLocation(), getNullPtrType(), getNumTemplateExpansions(), getPackAsArray(), getPackExpansionPattern(), getParamTypeForDecl(), clang::TemplateArgumentLoc::getSourceDeclExpression(), clang::TemplateArgumentLoc::getSourceExpression(), clang::TemplateArgumentLoc::getSourceIntegralExpression(), clang::TemplateArgumentLoc::getSourceNullPtrExpression(), clang::TemplateArgumentLoc::getSourceRange(), clang::Sema::getTemplateArgumentPackExpansionPattern(), clang::TemplateArgumentLoc::getTemplateEllipsisLoc(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), getTrivialTemplateArgumentLoc(), clang::TemplateArgumentLoc::getTypeSourceInfo(), hasTemplateArgumentForDeduction(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::TemplateSpecializationTypeLoc::initializeArgLocs(), clang::TreeTransform< Derived >::InventTemplateArgumentLoc(), isDependent(), isInstantiationDependent(), isNull(), isPackExpansion(), isSameAsPrimaryTemplate(), isSameTemplateArg(), IsStructurallyEquivalent(), isTemplateArgumentTemplateParameter(), MarkUsedTemplateParameters(), clang::operator<<(), pack_begin(), pack_end(), pack_size(), print(), Profile(), clang::ASTReader::ReadTemplateArgumentLoc(), clang::ASTReader::ReadTemplateName(), clang::TreeTransform< Derived >::RebuildPackExpansion(), setIntegralType(), structurallyEquals(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::TemplateArgumentLoc::TemplateArgumentLoc(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::TreeTransform< Derived >::TransformTemplateArguments(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), and clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc().
QualType clang::TemplateArgument::getNullPtrType | ( | ) | const [inline] |
Retrieve the type for null non-type template argument.
Definition at line 258 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), NullPtr, and TypeOrValue.
Referenced by clang::ASTWriter::AddTemplateArgument(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), clang::ASTNodeImporter::ImportTemplateArgument(), isSameTemplateArg(), MarkUsedTemplateParameters(), and Profile().
Optional< unsigned > TemplateArgument::getNumTemplateExpansions | ( | ) | const |
Retrieve the number of expansions that a template template argument expansion will produce, if known.
Definition at line 225 of file TemplateBase.cpp.
References getKind(), TemplateArg, and TemplateExpansion.
Referenced by clang::ASTWriter::AddTemplateArgument(), clang::ASTContext::getCanonicalTemplateArgument(), clang::Sema::getTemplateArgumentPackExpansionPattern(), and clang::ASTNodeImporter::ImportTemplateArgument().
ArrayRef<TemplateArgument> clang::TemplateArgument::getPackAsArray | ( | ) | const [inline] |
Return the array of arguments in this template argument pack.
Definition at line 343 of file TemplateBase.h.
When the template argument is a pack expansion, returns the pattern of the pack expansion.
Definition at line 316 of file TemplateBase.cpp.
References Declaration, Expression, clang::Type::getAs(), getAsExpr(), getAsTemplateOrTemplatePattern(), getAsType(), getKind(), Integral, isPackExpansion(), Null, NullPtr, Pack, Template, TemplateArgument(), and TemplateExpansion.
Referenced by DeduceTemplateArguments(), getPackSubstitutedTemplateArgument(), clang::Sema::getTemplateArgumentPackExpansionPattern(), and isSameAsPrimaryTemplate().
QualType clang::TemplateArgument::getParamTypeForDecl | ( | ) | const [inline] |
Definition at line 252 of file TemplateBase.h.
References Declaration, DeclArg, clang::QualType::getFromOpaquePtr(), and getKind().
Referenced by clang::ASTWriter::AddTemplateArgument(), clang::ASTContext::getCanonicalTemplateArgument(), and clang::ASTNodeImporter::ImportTemplateArgument().
bool TemplateArgument::isDependent | ( | ) | const |
Whether this template argument is dependent on a template parameter such that its result can change from one instantiation to another.
Definition at line 87 of file TemplateBase.cpp.
References Declaration, Expression, getAsDecl(), getAsExpr(), getAsTemplate(), getAsType(), clang::Decl::getDeclContext(), getKind(), Integral, clang::TemplateName::isDependent(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), Null, NullPtr, P, Pack, pack_elements(), Template, and TemplateExpansion.
Whether this template argument is dependent on a template parameter.
Definition at line 128 of file TemplateBase.cpp.
References Declaration, Expression, getAsDecl(), getAsExpr(), getAsTemplate(), getAsType(), clang::Decl::getDeclContext(), getKind(), Integral, clang::DeclContext::isDependentContext(), clang::Expr::isInstantiationDependent(), clang::TemplateName::isInstantiationDependent(), clang::Type::isInstantiationDependentType(), Null, NullPtr, P, Pack, pack_elements(), Template, and TemplateExpansion.
bool clang::TemplateArgument::isNull | ( | ) | const [inline] |
Determine whether this template argument has no value.
Definition at line 221 of file TemplateBase.h.
References getKind(), and Null.
Referenced by checkDeducedTemplateArguments(), DeduceNonTypeTemplateArgument(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DiagnoseUnexpandedParameterPack(), PackDeductionScope::finish(), clang::Sema::FinishTemplateArgumentDeduction(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), clang::ASTImporter::Import(), clang::ASTNodeImporter::ImportTemplateArguments(), PackDeductionScope::nextPackElement(), and clang::TreeTransform< Derived >::TransformTemplateArguments().
bool TemplateArgument::isPackExpansion | ( | ) | const |
Determine whether this template argument is a pack expansion.
Definition at line 167 of file TemplateBase.cpp.
References Declaration, Expression, getAsExpr(), getAsType(), getKind(), Integral, Null, NullPtr, Pack, Template, and TemplateExpansion.
Referenced by DeduceTemplateArguments(), getPackExpansionPattern(), clang::Sema::getTemplateArgumentPackExpansionPattern(), hasPackExpansionBeforeEnd(), isSameAsPrimaryTemplate(), and clang::TreeTransform< Derived >::TransformTemplateArguments().
pack_iterator clang::TemplateArgument::pack_begin | ( | ) | const [inline] |
Iterator referencing the first argument of a template argument pack.
Definition at line 317 of file TemplateBase.h.
References Args, getKind(), and Pack.
Referenced by checkDeducedTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), getPackSubstitutedTemplateArgument(), clang::ASTContext::getSubstTemplateTemplateParmPack(), hasPackExpansionBeforeEnd(), hasTemplateArgumentForDeduction(), clang::ASTNodeImporter::ImportTemplateArgument(), isSameAsPrimaryTemplate(), isSameTemplateArg(), IsStructurallyEquivalent(), pack_elements(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::TreeTransform< Derived >::TransformTemplateArguments(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), and clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc().
llvm::iterator_range<pack_iterator> clang::TemplateArgument::pack_elements | ( | ) | const [inline] |
Iterator range referencing all of the elements of a template argument pack.
Definition at line 331 of file TemplateBase.h.
References pack_begin(), and pack_end().
Referenced by addAssociatedClassesAndNamespaces(), clang::ASTWriter::AddTemplateArgument(), containsUnexpandedParameterPack(), ConvertDeducedTemplateArgument(), clang::ASTContext::getSubstTemplateTypeParmPackType(), isDependent(), isInstantiationDependent(), MarkUsedTemplateParameters(), print(), and clang::SubstTemplateTypeParmPackType::Profile().
pack_iterator clang::TemplateArgument::pack_end | ( | ) | const [inline] |
Iterator referencing one past the last argument of a template argument pack.
Definition at line 324 of file TemplateBase.h.
References Args, getKind(), and Pack.
Referenced by checkDeducedTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), isSameTemplateArg(), pack_elements(), and clang::TreeTransform< Derived >::TransformTemplateArguments().
unsigned clang::TemplateArgument::pack_size | ( | ) | const [inline] |
The number of template arguments in the given template argument pack.
Definition at line 337 of file TemplateBase.h.
References Args, getKind(), and Pack.
Referenced by clang::ASTWriter::AddTemplateArgument(), checkDeducedTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), getPackSubstitutedTemplateArgument(), clang::ASTContext::getSubstTemplateTemplateParmPack(), hasPackExpansionBeforeEnd(), hasTemplateArgumentForDeduction(), clang::ASTNodeImporter::ImportTemplateArgument(), isSameAsPrimaryTemplate(), isSameTemplateArg(), IsStructurallyEquivalent(), clang::SubstTemplateTypeParmPackType::Profile(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), and clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc().
void TemplateArgument::print | ( | const PrintingPolicy & | Policy, |
raw_ostream & | Out | ||
) | const |
Print this template argument to the given output stream.
Definition at line 341 of file TemplateBase.cpp.
References Declaration, Expression, getAsDecl(), getAsExpr(), getAsTemplate(), getAsTemplateOrTemplatePattern(), getAsType(), clang::NamedDecl::getDeclName(), getKind(), Integral, Null, NullPtr, P, Pack, pack_elements(), clang::TemplateName::print(), clang::QualType::print(), printIntegral(), clang::Stmt::printPretty(), clang::NamedDecl::printQualifiedName(), clang::PrintingPolicy::SuppressStrongLifetime, Template, and TemplateExpansion.
Referenced by clang::PredefinedExpr::ComputeName(), clang::Sema::getTemplateArgumentBindingsText(), clang::operator<<(), and clang::TemplateSpecializationType::PrintTemplateArgumentList().
void TemplateArgument::Profile | ( | llvm::FoldingSetNodeID & | ID, |
const ASTContext & | Context | ||
) | const |
Used to insert TemplateArguments into FoldingSets.
Definition at line 233 of file TemplateBase.cpp.
References Args, Declaration, Expression, getAsDecl(), getAsExpr(), getAsIntegral(), clang::TemplateName::getAsTemplateDecl(), getAsTemplateOrTemplatePattern(), getAsType(), clang::TemplateName::getAsVoidPointer(), clang::ASTContext::getCanonicalTemplateName(), getIntegralType(), getKind(), getNullPtrType(), Integral, Null, NullPtr, Pack, clang::Stmt::Profile(), clang::QualType::Profile(), Template, and TemplateExpansion.
Referenced by clang::SubstTemplateTemplateParmPackStorage::Profile().
void clang::TemplateArgument::setIntegralType | ( | QualType | T | ) | [inline] |
Definition at line 301 of file TemplateBase.h.
References clang::QualType::getAsOpaquePtr(), getKind(), Integer, and Integral.
bool TemplateArgument::structurallyEquals | ( | const TemplateArgument & | Other | ) | const |
Determines whether two template arguments are superficially the same.
Definition at line 286 of file TemplateBase.cpp.
References Args, Declaration, Expression, getAsDecl(), getAsIntegral(), getIntegralType(), getKind(), Integral, Null, NullPtr, Pack, Template, TemplateExpansion, and TypeOrValue.
struct A clang::TemplateArgument::Args |
Definition at line 112 of file TemplateBase.h.
Referenced by getPackAsArray(), pack_begin(), pack_end(), pack_size(), Profile(), structurallyEquals(), and TemplateArgument().
struct DA clang::TemplateArgument::DeclArg |
Definition at line 110 of file TemplateBase.h.
Referenced by getAsDecl(), getParamTypeForDecl(), and TemplateArgument().
struct I clang::TemplateArgument::Integer |
Definition at line 111 of file TemplateBase.h.
Referenced by getAsIntegral(), getIntegralType(), setIntegralType(), and TemplateArgument().
struct TA clang::TemplateArgument::TemplateArg |
Definition at line 113 of file TemplateBase.h.
Referenced by getAsTemplate(), getAsTemplateOrTemplatePattern(), getNumTemplateExpansions(), and TemplateArgument().
struct TV clang::TemplateArgument::TypeOrValue |
Definition at line 114 of file TemplateBase.h.
Referenced by getAsExpr(), getAsType(), getKind(), getNullPtrType(), structurallyEquals(), and TemplateArgument().