clang 17.0.0git
|
Represents a template argument. More...
#include "clang/AST/TemplateBase.h"
Public Types | |
enum | ArgKind { Null = 0 , Type , Declaration , NullPtr , Integral , Template , TemplateExpansion , Expression , Pack } |
The kind of template argument we're storing. More... | |
using | pack_iterator = const TemplateArgument * |
Iterator that traverses the elements of a template argument pack. | |
Public Member Functions | |
constexpr | TemplateArgument () |
Construct an empty, invalid template argument. | |
TemplateArgument (QualType T, bool isNullPtr=false, bool IsDefaulted=false) | |
Construct a template type argument. | |
TemplateArgument (ValueDecl *D, QualType QT, bool IsDefaulted=false) | |
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, bool IsDefaulted=false) | |
Construct an integral constant template argument. | |
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, bool IsDefaulted=false) | |
Construct a template argument that is a template. | |
TemplateArgument (TemplateName Name, std::optional< unsigned > NumExpansions, bool IsDefaulted=false) | |
Construct a template argument that is a template pack expansion. | |
TemplateArgument (Expr *E, bool IsDefaulted=false) | |
Construct a template argument that is an expression. | |
TemplateArgument (ArrayRef< TemplateArgument > Args) | |
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. | |
TemplateArgumentDependence | getDependence () const |
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. | |
std::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) |
void | setIsDefaulted (bool v) |
Set to 'true' if this TemplateArgument corresponds to a default template parameter. | |
bool | getIsDefaulted () const |
If returns 'true', this TemplateArgument corresponds to a default template parameter. | |
QualType | getNonTypeTemplateArgumentType () const |
If this is a non-type template argument, get its type. | |
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. | |
ArrayRef< TemplateArgument > | 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, bool IncludeType) const |
Print this template argument to the given output stream. | |
void | dump (raw_ostream &Out) const |
Debugging aid that dumps the template argument. | |
void | dump () const |
Debugging aid that dumps the template argument to standard error. | |
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, ArrayRef< TemplateArgument > Args) |
Create a new template argument pack by copying the given set of template arguments. | |
Represents a template argument.
Definition at line 60 of file TemplateBase.h.
using clang::TemplateArgument::pack_iterator = const TemplateArgument * |
Iterator that traverses the elements of a template argument pack.
Definition at line 374 of file TemplateBase.h.
The kind of template argument we're storing.
Enumerator | |
---|---|
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). |
Pack | The template argument is actually a parameter pack. Arguments are stored in the Args struct. |
Definition at line 63 of file TemplateBase.h.
|
inlineconstexpr |
Construct an empty, invalid template argument.
Definition at line 155 of file TemplateBase.h.
References Null.
Referenced by CreatePackCopy(), getEmptyPack(), and getPackExpansionPattern().
|
inline |
Construct a template type argument.
Definition at line 158 of file TemplateBase.h.
References clang::QualType::getAsOpaquePtr(), NullPtr, Type, and TypeOrValue.
|
inline |
Construct a template argument that refers to a declaration, which is either an external declaration or a template declaration.
Definition at line 168 of file TemplateBase.h.
References Declaration, DeclArg, and clang::QualType::getAsOpaquePtr().
TemplateArgument::TemplateArgument | ( | ASTContext & | Ctx, |
const llvm::APSInt & | Value, | ||
QualType | Type, | ||
bool | IsDefaulted = false |
||
) |
Construct an integral constant template argument.
The memory to store the value is allocated with Ctx.
Definition at line 163 of file TemplateBase.cpp.
References clang::ASTContext::Allocate(), Integer, and Integral.
|
inline |
Construct an integral constant template argument with the same value as Other but a different type.
Definition at line 183 of file TemplateBase.h.
References Integer.
|
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. |
IsDefaulted | If 'true', implies that this TemplateArgument corresponds to a default template parameter |
Definition at line 199 of file TemplateBase.h.
References Template, and TemplateArg.
|
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 |
IsDefaulted | If 'true', implies that this TemplateArgument corresponds to a default template parameter |
Definition at line 220 of file TemplateBase.h.
References TemplateArg, and TemplateExpansion.
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 236 of file TemplateBase.h.
References Expression, and TypeOrValue.
|
inlineexplicit |
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 246 of file TemplateBase.h.
bool TemplateArgument::containsUnexpandedParameterPack | ( | ) | const |
Whether this template argument contains an unexpanded parameter pack.
Definition at line 271 of file TemplateBase.cpp.
References getDependence().
Referenced by clang::Sema::DiagnoseUnexpandedParameterPack(), and clang::Sema::getFullyPackExpandedSize().
|
static |
Create a new template argument pack by copying the given set of template arguments.
Definition at line 184 of file TemplateBase.cpp.
References Args, getEmptyPack(), and TemplateArgument().
Referenced by checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgumentList(), ConvertDeducedTemplateArgument(), clang::ASTContext::getCanonicalTemplateArgument(), and clang::ASTContext::getInjectedTemplateArg().
LLVM_DUMP_METHOD void TemplateArgument::dump | ( | ) | const |
Debugging aid that dumps the template argument to standard error.
Definition at line 487 of file TemplateBase.cpp.
References dump().
Referenced by dump().
void TemplateArgument::dump | ( | raw_ostream & | Out | ) | const |
Debugging aid that dumps the template argument.
Definition at line 480 of file TemplateBase.cpp.
References print().
|
inline |
Retrieve the declaration for a declaration non-type template argument.
Definition at line 294 of file TemplateBase.h.
References Declaration, DeclArg, and getKind().
Referenced by clang::ODRHash::AddTemplateArgument(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), DiagTemplateArg(), clang::ASTContext::getCanonicalTemplateArgument(), getDependence(), clang::ASTNodeImporter::import(), isSameTemplateArg(), IsStructurallyEquivalent(), print(), Profile(), structurallyEquals(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::JSONNodeDumper::VisitDeclarationTemplateArgument(), and clang::TextNodeDumper::VisitDeclarationTemplateArgument().
|
inline |
Retrieve the template argument as an expression.
Definition at line 368 of file TemplateBase.h.
References getKind(), and TypeOrValue.
Referenced by clang::ODRHash::AddTemplateArgument(), clang::ASTRecordWriter::AddTemplateArgumentLoc(), checkDeducedTemplateArguments(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), DeduceTemplateArguments(), DiagTemplateArg(), getCommonTemplateArgument(), getDependence(), clang::Sema::getFullyPackExpandedSize(), getNonTypeTemplateArgumentType(), getPackExpansionPattern(), clang::Sema::getTemplateArgumentPackExpansionPattern(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::import(), isPackExpansion(), isSameTemplateArg(), IsStructurallyEquivalent(), isSubstitutedTemplateArgument(), isTemplateArgumentTemplateParameter(), print(), Profile(), clang::ASTRecordReader::readTemplateArgumentLoc(), templateArgumentExpressionsEqual(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitExpressionTemplateArgument().
|
inline |
Retrieve the template argument as an integral value.
Definition at line 331 of file TemplateBase.h.
References getKind(), Integer, and Integral.
Referenced by clang::ODRHash::AddTemplateArgument(), clang::Sema::BuildExpressionFromIntegralTemplateArgument(), checkBuiltinTemplateIdType(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), DiagTemplateArg(), isSameTemplateArg(), IsStructurallyEquivalent(), printIntegral(), Profile(), structurallyEquals(), templateArgumentExpressionsEqual(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::JSONNodeDumper::VisitIntegralTemplateArgument(), and clang::TextNodeDumper::VisitIntegralTemplateArgument().
|
inline |
Retrieve the template name for a template name argument.
Definition at line 311 of file TemplateBase.h.
References clang::TemplateName::getFromVoidPointer(), getKind(), Template, and TemplateArg.
Referenced by clang::Sema::ActOnTemplateTemplateParameter(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), DiagnoseBadDeduction(), DiagTemplateArg(), clang::ASTContext::getCanonicalTemplateArgument(), getCommonTemplateArgument(), getDependence(), clang::Sema::getFullyPackExpandedSize(), clang::TypeName::getFullyQualifiedTemplateArgument(), clang::ASTNodeImporter::import(), clang::ASTContext::isSameDefaultTemplateArgument(), IsStructurallyEquivalent(), isSubstitutedTemplateArgument(), print(), clang::TreeTransform< Derived >::RebuildPackExpansion(), SubstDefaultTemplateArgument(), clang::TreeTransform< Derived >::TransformTemplateArgument(), and clang::TextNodeDumper::VisitTemplateTemplateArgument().
|
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 318 of file TemplateBase.h.
References clang::TemplateName::getFromVoidPointer(), getKind(), Template, TemplateArg, and TemplateExpansion.
Referenced by addAssociatedClassesAndNamespaces(), clang::ODRHash::AddTemplateArgument(), checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), DiagTemplateArg(), clang::ASTContext::getCanonicalTemplateArgument(), getCommonTemplateArgument(), getPackExpansionPattern(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::import(), isSameTemplateArg(), IsStructurallyEquivalent(), isTemplateArgumentTemplateParameter(), print(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc(), and clang::TextNodeDumper::VisitTemplateExpansionTemplateArgument().
|
inline |
Retrieve the type for a type template argument.
Definition at line 287 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), and TypeOrValue.
Referenced by addAssociatedClassesAndNamespaces(), addInstanceOfTransition(), clang::ODRHash::AddTemplateArgument(), checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), DeduceTemplateArguments(), DiagnoseBadDeduction(), DiagTemplateArg(), clang::ASTContext::getCanonicalTemplateArgument(), getCommonTemplateArgument(), getDependence(), clang::Sema::getFullyPackExpandedSize(), clang::TypeName::getFullyQualifiedTemplateArgument(), getPackExpansionPattern(), clang::Sema::getTemplateArgumentPackExpansionPattern(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::import(), isPackExpansion(), isSameTemplateArg(), IsStructurallyEquivalent(), isSubstitutedTemplateArgument(), isTemplateArgumentTemplateParameter(), print(), Profile(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc(), TryDeconstructFunctionLike(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitTypeTemplateArgument(), clang::JSONNodeDumper::VisitTypeTemplateArgument(), and clang::TextNodeDumper::VisitTypeTemplateArgument().
TemplateArgumentDependence TemplateArgument::getDependence | ( | ) | const |
Definition at line 192 of file TemplateBase.cpp.
References Declaration, Expression, getAsDecl(), getAsExpr(), getAsTemplate(), getAsType(), clang::Decl::getDeclContext(), getDependence(), getKind(), Integral, Null, NullPtr, P, Pack, pack_elements(), Template, TemplateExpansion, clang::toTemplateArgumentDependence(), and Type.
Referenced by containsUnexpandedParameterPack(), getDependence(), isDependent(), and isInstantiationDependent().
|
inlinestatic |
Definition at line 253 of file TemplateBase.h.
References TemplateArgument().
Referenced by CreatePackCopy().
|
inline |
Retrieve the type of the integral value.
Definition at line 345 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), Integer, and Integral.
Referenced by clang::Sema::BuildExpressionFromIntegralTemplateArgument(), DeduceTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), getNonTypeTemplateArgumentType(), clang::ASTNodeImporter::import(), IsStructurallyEquivalent(), printIntegral(), Profile(), and structurallyEquals().
|
inline |
If returns 'true', this TemplateArgument corresponds to a default template parameter.
Definition at line 361 of file TemplateBase.h.
References TypeOrValue.
Referenced by clang::ASTContext::getCanonicalTemplateArgument(), clang::ASTNodeImporter::import(), and printTo().
|
inline |
Return the kind of stored template argument.
Definition at line 263 of file TemplateBase.h.
References TypeOrValue.
Referenced by addAssociatedClassesAndNamespaces(), addInstanceOfTransition(), clang::ODRHash::AddTemplateArgument(), clang::ASTRecordWriter::AddTemplateArgumentLoc(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildExpressionFromIntegralTemplateArgument(), checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), ConvertDeducedTemplateArgument(), DeduceTemplateArguments(), describeTemplateParameter(), DiagnoseBadDeduction(), DiagTemplateArg(), getAsDecl(), getAsExpr(), getAsIntegral(), getAsTemplate(), getAsTemplateOrTemplatePattern(), getAsType(), clang::ASTContext::getCanonicalTemplateArgument(), getCommonTemplateArgument(), getDependence(), clang::Sema::getFullyPackExpandedSize(), clang::TypeName::getFullyQualifiedTemplateArgument(), clang::comments::getFunctionTypeLoc(), getIntegralType(), clang::TemplateArgumentLoc::getLocation(), getMoreSpecialized(), clang::Sema::getMoreSpecializedTemplate(), getNonTypeTemplateArgumentType(), 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(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::TemplateArgumentLoc::getTypeSourceInfo(), hasTemplateArgumentForDeduction(), clang::ASTNodeImporter::import(), isEnableIf(), isNull(), isPackExpansion(), isSameAsPrimaryTemplate(), isSameTemplateArg(), IsStructurallyEquivalent(), clang::isSubstitutedDefaultArgument(), isSubstitutedTemplateArgument(), isTemplateArgumentTemplateParameter(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), pack_begin(), pack_end(), pack_size(), print(), printArgument(), printTo(), Profile(), clang::ASTRecordReader::readTemplateArgumentLoc(), clang::TreeTransform< Derived >::RebuildPackExpansion(), ReferencesAnonymousEntity(), setIntegralType(), structurallyEquals(), clang::Sema::SubstituteExplicitTemplateArguments(), templateArgumentExpressionsEqual(), clang::TemplateArgumentLoc::TemplateArgumentLoc(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::TreeTransform< Derived >::TransformTemplateArguments(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc(), TryDeconstructFunctionLike(), and clang::templateargumentvisitor::Base< Ref, ImplClass, RetTy, ParamTys >::Visit().
QualType TemplateArgument::getNonTypeTemplateArgumentType | ( | ) | const |
If this is a non-type template argument, get its type.
Otherwise, returns a null QualType.
Definition at line 283 of file TemplateBase.cpp.
References Declaration, Expression, getAsExpr(), getIntegralType(), getKind(), getNullPtrType(), getParamTypeForDecl(), clang::Expr::getType(), Integral, Null, NullPtr, Pack, Template, TemplateExpansion, and Type.
Referenced by checkDeducedTemplateArguments(), DiagnoseBadDeduction(), and clang::TreeTransform< Derived >::TransformTemplateArgument().
|
inline |
Retrieve the type for null non-type template argument.
Definition at line 305 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), NullPtr, and TypeOrValue.
Referenced by checkDeducedTemplateArguments(), DeduceTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), getCommonTemplateArgument(), getNonTypeTemplateArgumentType(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::import(), isSameTemplateArg(), and Profile().
std::optional< unsigned > TemplateArgument::getNumTemplateExpansions | ( | ) | const |
Retrieve the number of expansions that a template template argument expansion will produce, if known.
Definition at line 275 of file TemplateBase.cpp.
References getKind(), TemplateArg, and TemplateExpansion.
Referenced by clang::ASTContext::getCanonicalTemplateArgument(), getCommonTemplateArgument(), clang::Sema::getTemplateArgumentPackExpansionPattern(), and clang::ASTNodeImporter::import().
|
inline |
Return the array of arguments in this template argument pack.
Definition at line 404 of file TemplateBase.h.
References Args, getKind(), and Pack.
Referenced by describeTemplateParameter(), and printTo().
TemplateArgument TemplateArgument::getPackExpansionPattern | ( | ) | const |
When the template argument is a pack expansion, returns the pattern of the pack expansion.
Definition at line 385 of file TemplateBase.cpp.
References clang::Type::castAs(), Declaration, Expression, getAsExpr(), getAsTemplateOrTemplatePattern(), getAsType(), getKind(), Integral, isPackExpansion(), Null, NullPtr, Pack, Template, TemplateArgument(), TemplateExpansion, and Type.
Referenced by DeduceTemplateArguments(), getPackSubstitutedTemplateArgument(), clang::Sema::getTemplateArgumentPackExpansionPattern(), and isSameAsPrimaryTemplate().
|
inline |
Definition at line 299 of file TemplateBase.h.
References Declaration, DeclArg, clang::QualType::getFromOpaquePtr(), and getKind().
Referenced by DeduceTemplateArguments(), clang::ASTContext::getCanonicalTemplateArgument(), getNonTypeTemplateArgumentType(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::ASTNodeImporter::import(), print(), Profile(), and structurallyEquals().
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 240 of file TemplateBase.cpp.
References getDependence().
Referenced by checkBuiltinTemplateIdType().
bool TemplateArgument::isInstantiationDependent | ( | ) | const |
Whether this template argument is dependent on a template parameter.
Definition at line 244 of file TemplateBase.cpp.
References getDependence().
Referenced by clang::MultiLevelTemplateArgumentList::isAnyArgInstantiationDependent().
|
inline |
Determine whether this template argument has no value.
Definition at line 266 of file TemplateBase.h.
References getKind(), and Null.
Referenced by checkDeducedTemplateArguments(), clang::Sema::CheckTemplateArgument(), ConvertDeducedTemplateArguments(), clang::Sema::DiagnoseUnexpandedParameterPack(), and clang::TemplateTemplateParmDecl::setDefaultArgument().
bool TemplateArgument::isPackExpansion | ( | ) | const |
Determine whether this template argument is a pack expansion.
Definition at line 248 of file TemplateBase.cpp.
References Declaration, Expression, getAsExpr(), getAsType(), getKind(), Integral, Null, NullPtr, Pack, Template, TemplateExpansion, and Type.
Referenced by DeduceTemplateArguments(), getPackExpansionPattern(), getPackSubstitutedTemplateArgument(), clang::Sema::getTemplateArgumentPackExpansionPattern(), isSameAsPrimaryTemplate(), isSameTemplateArg(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), and clang::TreeTransform< Derived >::TransformTemplateArguments().
|
inline |
Iterator referencing the first argument of a template argument pack.
Definition at line 378 of file TemplateBase.h.
References Args, getKind(), and Pack.
Referenced by checkDeducedTemplateArguments(), getPackSubstitutedTemplateArgument(), isSameAsPrimaryTemplate(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), pack_elements(), clang::Sema::SubstituteExplicitTemplateArguments(), and clang::TreeTransform< Derived >::TransformTemplateArguments().
|
inline |
Iterator range referencing all of the elements of a template argument pack.
Definition at line 392 of file TemplateBase.h.
References pack_begin(), and pack_end().
Referenced by addAssociatedClassesAndNamespaces(), addInstanceOfTransition(), clang::ODRHash::AddTemplateArgument(), ConvertDeducedTemplateArgument(), clang::ASTContext::getCanonicalTemplateArgument(), getDependence(), clang::Sema::getFullyPackExpandedSize(), getMoreSpecialized(), clang::Sema::getMoreSpecializedTemplate(), clang::ASTContext::getSubstTemplateTemplateParmPack(), clang::ASTContext::getSubstTemplateTypeParmPackType(), hasTemplateArgumentForDeduction(), clang::ASTNodeImporter::import(), isSameTemplateArg(), IsStructurallyEquivalent(), print(), clang::SubstTemplateTypeParmPackType::Profile(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitPackTemplateArgument().
|
inline |
Iterator referencing one past the last argument of a template argument pack.
Definition at line 385 of file TemplateBase.h.
References Args, getKind(), and Pack.
Referenced by pack_elements(), and clang::TreeTransform< Derived >::TransformTemplateArguments().
|
inline |
The number of template arguments in the given template argument pack.
Definition at line 398 of file TemplateBase.h.
References Args, getKind(), and Pack.
Referenced by clang::ODRHash::AddTemplateArgument(), checkDeducedTemplateArguments(), DiagnoseBadDeduction(), clang::Sema::getFullyPackExpandedSize(), getMoreSpecialized(), clang::Sema::getMoreSpecializedTemplate(), getPackSubstitutedTemplateArgument(), clang::ASTNodeImporter::import(), isSameAsPrimaryTemplate(), isSameTemplateArg(), clang::isSubstitutedDefaultArgument(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), printTo(), clang::SubstTemplateTypeParmPackType::Profile(), and clang::Sema::SubstituteExplicitTemplateArguments().
void TemplateArgument::print | ( | const PrintingPolicy & | Policy, |
raw_ostream & | Out, | ||
bool | IncludeType | ||
) | const |
Print this template argument to the given output stream.
Definition at line 410 of file TemplateBase.cpp.
References Declaration, Expression, clang::First, clang::TemplateName::Fully, getAsDecl(), getAsExpr(), getAsTemplate(), getAsTemplateOrTemplatePattern(), getAsType(), getKind(), getParamTypeForDecl(), Integral, isRecordType(), needsAmpersandOnTemplateArg(), Null, NullPtr, P, Pack, pack_elements(), clang::QualType::print(), clang::TemplateName::print(), printIntegral(), clang::Stmt::printPretty(), clang::NamedDecl::printQualifiedName(), clang::PrintingPolicy::SuppressStrongLifetime, Template, TemplateExpansion, and Type.
Referenced by clang::PredefinedExpr::ComputeName(), describeTemplateParameter(), DiagTemplateArg(), dump(), clang::Sema::getTemplateArgumentBindingsText(), and printArgument().
void TemplateArgument::Profile | ( | llvm::FoldingSetNodeID & | ID, |
const ASTContext & | Context | ||
) | const |
Used to insert TemplateArguments into FoldingSets.
Definition at line 308 of file TemplateBase.cpp.
References Args, Declaration, Expression, getAsDecl(), getAsExpr(), getAsIntegral(), getAsType(), getIntegralType(), getKind(), getNullPtrType(), getParamTypeForDecl(), Integral, Null, NullPtr, Pack, clang::QualType::Profile(), clang::Stmt::Profile(), Template, TemplateArg, TemplateExpansion, and Type.
Referenced by clang::SubstTemplateTemplateParmPackStorage::Profile().
|
inline |
Definition at line 350 of file TemplateBase.h.
References clang::QualType::getAsOpaquePtr(), getKind(), Integer, and Integral.
|
inline |
Set to 'true' if this TemplateArgument corresponds to a default template parameter.
Definition at line 357 of file TemplateBase.h.
References TypeOrValue, and v.
bool TemplateArgument::structurallyEquals | ( | const TemplateArgument & | Other | ) | const |
Determines whether two template arguments are superficially the same.
Definition at line 351 of file TemplateBase.cpp.
References Args, Declaration, Expression, getAsDecl(), getAsIntegral(), getIntegralType(), getKind(), getParamTypeForDecl(), Integral, Null, NullPtr, Pack, Template, TemplateArg, TemplateExpansion, Type, and TypeOrValue.
Referenced by clang::ASTContext::getSubstTemplateTypeParmPackType(), and isSubstitutedTemplateArgument().
struct A clang::TemplateArgument::Args |
Definition at line 148 of file TemplateBase.h.
Referenced by CreatePackCopy(), getPackAsArray(), clang::MultiLevelTemplateArgumentList::isAnyArgInstantiationDependent(), pack_begin(), pack_end(), pack_size(), Profile(), structurallyEquals(), and TemplateArgument().
struct DA clang::TemplateArgument::DeclArg |
Definition at line 146 of file TemplateBase.h.
Referenced by getAsDecl(), getParamTypeForDecl(), and TemplateArgument().
struct I clang::TemplateArgument::Integer |
Definition at line 147 of file TemplateBase.h.
Referenced by getAsIntegral(), getIntegralType(), setIntegralType(), and TemplateArgument().
struct TA clang::TemplateArgument::TemplateArg |
Definition at line 149 of file TemplateBase.h.
Referenced by getAsTemplate(), getAsTemplateOrTemplatePattern(), getNumTemplateExpansions(), Profile(), structurallyEquals(), and TemplateArgument().
struct TV clang::TemplateArgument::TypeOrValue |
Definition at line 150 of file TemplateBase.h.
Referenced by getAsExpr(), getAsType(), getIsDefaulted(), getKind(), getNullPtrType(), setIsDefaulted(), structurallyEquals(), and TemplateArgument().