clang: clang::TemplateArgument Class Reference (original) (raw)
Represents a template argument. More...
#include "[clang/AST/TemplateBase.h](TemplateBase%5F8h%5Fsource.html)"
Public Types | |
---|---|
enum | ArgKind { Null = 0 , Type, Declaration, NullPtr, Integral, StructuralValue, 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 (non-dependent) declaration. | |
TemplateArgument (const ASTContext &Ctx, const llvm::APSInt &Value, QualType Type, bool IsDefaulted=false) | |
Construct an integral constant template argument. | |
TemplateArgument (const ASTContext &Ctx, QualType Type, const APValue &Value, bool IsDefaulted=false) | |
Construct a template argument from an arbitrary constant value. | |
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. | |
const APValue & | getAsStructuralValue () const |
Get the value of a StructuralValue. | |
QualType | getStructuralValueType () const |
Get the type of a StructuralValue. | |
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 ASTContext &Context) 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 61 of file TemplateBase.h.
◆ pack_iterator
Iterator that traverses the elements of a template argument pack.
Definition at line 414 of file TemplateBase.h.
◆ ArgKind
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. |
StructuralValue | The template argument is a non-type template argument that can't be represented by the special-case Declaration, NullPtr, or Integral forms. These values are only ever produced by constant evaluation, so cannot be dependent. TODO: merge Declaration, NullPtr and Integral into this? |
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 64 of file TemplateBase.h.
constexpr clang::TemplateArgument::TemplateArgument ( ) | inlineconstexpr |
---|
◆ TemplateArgument() [2/10]
◆ TemplateArgument() [3/10]
Construct a template argument that refers to a (non-dependent) declaration.
Definition at line 200 of file TemplateBase.h.
References D.
◆ TemplateArgument() [4/10]
Construct an integral constant template argument.
The memory to store the value is allocated with Ctx.
Definition at line 207 of file TemplateBase.cpp.
◆ TemplateArgument() [5/10]
◆ TemplateArgument() [6/10]
Construct an integral constant template argument with the same value as Other but a different type.
Definition at line 215 of file TemplateBase.h.
References Integer, and clang::Other.
◆ TemplateArgument() [7/10]
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.
Parameters
Name | The template name. |
---|---|
IsDefaulted | If 'true', implies that this TemplateArgument corresponds to a default template parameter |
Definition at line 231 of file TemplateBase.h.
References Template, and TemplateArg.
◆ TemplateArgument() [8/10]
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.
Parameters
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 252 of file TemplateBase.h.
References TemplateArg, and TemplateExpansion.
◆ TemplateArgument() [9/10]
clang::TemplateArgument::TemplateArgument ( Expr * E, bool IsDefaulted = false ) | 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 268 of file TemplateBase.h.
References E, Expression, and TypeOrValue.
◆ TemplateArgument() [10/10]
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 278 of file TemplateBase.h.
◆ containsUnexpandedParameterPack()
bool TemplateArgument::containsUnexpandedParameterPack | ( | ) | const |
---|
◆ CreatePackCopy()
◆ dump() [1/2]
LLVM_DUMP_METHOD void TemplateArgument::dump | ( | ) | const |
---|
◆ dump() [2/2]
void clang::TemplateArgument::dump | ( | raw_ostream & | Out, |
---|---|---|---|
const ASTContext & | Context | ||
) | const |
Debugging aid that dumps the template argument.
◆ getAsDecl()
ValueDecl * clang::TemplateArgument::getAsDecl ( ) const | inline |
---|
Retrieve the declaration for a declaration non-type template argument.
Definition at line 326 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().
◆ getAsExpr()
Expr * clang::TemplateArgument::getAsExpr ( ) const | inline |
---|
Retrieve the template argument as an expression.
Definition at line 408 of file TemplateBase.h.
References getKind(), and TypeOrValue.
Referenced by clang::ODRHash::AddTemplateArgument(), clang::ASTRecordWriter::AddTemplateArgumentLoc(), clang::Sema::BuildExpressionFromNonTypeTemplateArgument(), checkDeducedTemplateArguments(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), 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().
◆ getAsIntegral()
llvm::APSInt clang::TemplateArgument::getAsIntegral ( ) const | inline |
---|
Retrieve the template argument as an integral value.
Definition at line 363 of file TemplateBase.h.
References getKind(), Integer, and Integral.
Referenced by clang::ODRHash::AddTemplateArgument(), clang::Sema::BuildExpressionFromNonTypeTemplateArgument(), checkBuiltinTemplateIdType(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), DiagTemplateArg(), isSameTemplateArg(), IsStructurallyEquivalent(), printIntegral(), Profile(), structurallyEquals(), templateArgumentExpressionsEqual(), clang::TreeTransform< Derived >::TransformTemplateArgument(), and clang::JSONNodeDumper::VisitIntegralTemplateArgument().
◆ getAsStructuralValue()
const APValue & clang::TemplateArgument::getAsStructuralValue ( ) const | inline |
---|
◆ getAsTemplate()
TemplateName clang::TemplateArgument::getAsTemplate ( ) const | inline |
---|
Retrieve the template name for a template name argument.
Definition at line 343 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().
◆ getAsTemplateOrTemplatePattern()
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 350 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(), CXXNameMangler::TemplateArgManglingInfo::needToMangleTemplateParam(), print(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc(), and clang::TextNodeDumper::VisitTemplateExpansionTemplateArgument().
◆ getAsType()
QualType clang::TemplateArgument::getAsType ( ) const | inline |
---|
Retrieve the type for a type template argument.
Definition at line 319 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), and TypeOrValue.
Referenced by addAssociatedClassesAndNamespaces(), addInstanceOfTransition(), clang::ODRHash::AddTemplateArgument(), builtinCommonTypeImpl(), checkDeducedTemplateArguments(), clang::Sema::CheckParameterPacksForExpansion(), 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(), and clang::JSONNodeDumper::VisitTypeTemplateArgument().
◆ getDependence()
TemplateArgumentDependence TemplateArgument::getDependence | ( | ) | const |
---|
Definition at line 262 of file TemplateBase.cpp.
References Declaration, Expression, getAsDecl(), getAsExpr(), getAsTemplate(), getAsType(), clang::Decl::getDeclContext(), getDependence(), getKind(), Integral, Null, NullPtr, P, Pack, pack_elements(), StructuralValue, Template, TemplateExpansion, clang::toTemplateArgumentDependence(), and Type.
Referenced by containsUnexpandedParameterPack(), getDependence(), isDependent(), and isInstantiationDependent().
◆ getEmptyPack()
◆ getIntegralType()
QualType clang::TemplateArgument::getIntegralType ( ) const | inline |
---|
Retrieve the type of the integral value.
Definition at line 377 of file TemplateBase.h.
References clang::QualType::getFromOpaquePtr(), getKind(), Integer, and Integral.
Referenced by clang::Sema::BuildExpressionFromNonTypeTemplateArgument(), clang::ASTContext::getCanonicalTemplateArgument(), getNonTypeTemplateArgumentType(), clang::ASTNodeImporter::import(), IsStructurallyEquivalent(), printIntegral(), Profile(), and structurallyEquals().
◆ getIsDefaulted()
bool clang::TemplateArgument::getIsDefaulted ( ) const | inline |
---|
◆ getKind()
ArgKind clang::TemplateArgument::getKind ( ) const | inline |
---|
Return the kind of stored template argument.
Definition at line 295 of file TemplateBase.h.
References TypeOrValue.
Referenced by addAssociatedClassesAndNamespaces(), addInstanceOfTransition(), clang::ODRHash::AddTemplateArgument(), clang::ASTRecordWriter::AddTemplateArgumentLoc(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildExpressionFromNonTypeTemplateArgument(), checkDeducedTemplateArguments(), clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateTypeArgument(), ConvertDeducedTemplateArgument(), DeduceTemplateArguments(), describeTemplateParameter(), DiagnoseBadDeduction(), DiagTemplateArg(), CXXNameMangler::TemplateArgManglingInfo::getArgInfo(), 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::TemplateArgumentLoc::getSourceStructuralValueExpression(), 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(), CXXNameMangler::TemplateArgManglingInfo::needToMangleTemplateParam(), 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::RecursiveASTVisitor< Derived >::TraverseTemplateArgument(), clang::RecursiveASTVisitor< Derived >::TraverseTemplateArgumentLoc(), TryDeconstructFunctionLike(), clang::templateargumentvisitor::Base< Ref, ImplClass, RetTy, ParamTys >::Visit(), and clang::ASTDeclWriter::VisitCXXMethodDecl().
◆ getNonTypeTemplateArgumentType()
QualType TemplateArgument::getNonTypeTemplateArgumentType | ( | ) | const |
---|
If this is a non-type template argument, get its type.
Otherwise, returns a null QualType.
Definition at line 355 of file TemplateBase.cpp.
References Declaration, Expression, getAsExpr(), getIntegralType(), getKind(), getNullPtrType(), getParamTypeForDecl(), getStructuralValueType(), clang::Expr::getType(), Integral, Null, NullPtr, Pack, StructuralValue, Template, TemplateExpansion, and Type.
Referenced by clang::Sema::BuildExpressionFromNonTypeTemplateArgument(), checkDeducedTemplateArguments(), DeduceTemplateArguments(), DiagnoseBadDeduction(), and clang::TreeTransform< Derived >::TransformTemplateArgument().
◆ getNullPtrType()
QualType clang::TemplateArgument::getNullPtrType ( ) const | inline |
---|
Retrieve the type for null non-type template argument.
Definition at line 337 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().
◆ getNumTemplateExpansions()
std::optional< unsigned > TemplateArgument::getNumTemplateExpansions | ( | ) | const |
---|
◆ getPackAsArray()
◆ getPackExpansionPattern()
When the template argument is a pack expansion, returns the pattern of the pack expansion.
Definition at line 476 of file TemplateBase.cpp.
References clang::Type::castAs(), Declaration, Expression, getAsExpr(), getAsTemplateOrTemplatePattern(), getAsType(), getKind(), Integral, isPackExpansion(), Null, NullPtr, Pack, StructuralValue, Template, TemplateArgument(), TemplateExpansion, and Type.
Referenced by DeduceTemplateArguments(), getPackSubstitutedTemplateArgument(), clang::Sema::getTemplateArgumentPackExpansionPattern(), and isSameAsPrimaryTemplate().
◆ getParamTypeForDecl()
QualType clang::TemplateArgument::getParamTypeForDecl ( ) const | inline |
---|
Definition at line 331 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().
◆ getStructuralValueType()
QualType clang::TemplateArgument::getStructuralValueType ( ) const | inline |
---|
◆ isDependent()
bool TemplateArgument::isDependent | ( | ) | const |
---|
◆ isInstantiationDependent()
bool TemplateArgument::isInstantiationDependent | ( | ) | const |
---|
◆ isNull()
bool clang::TemplateArgument::isNull ( ) const | inline |
---|
◆ isPackExpansion()
bool TemplateArgument::isPackExpansion | ( | ) | const |
---|
Determine whether this template argument is a pack expansion.
Definition at line 319 of file TemplateBase.cpp.
References Declaration, Expression, getAsExpr(), getAsType(), getKind(), Integral, Null, NullPtr, Pack, StructuralValue, Template, TemplateExpansion, and Type.
Referenced by clang::Sema::CheckParameterPacksForExpansion(), DeduceTemplateArguments(), CXXNameMangler::TemplateArgManglingInfo::getArgInfo(), getPackExpansionPattern(), getPackSubstitutedTemplateArgument(), clang::Sema::getTemplateArgumentPackExpansionPattern(), isSameAsPrimaryTemplate(), isSameTemplateArg(), and clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs().
◆ pack_begin()
pack_iterator clang::TemplateArgument::pack_begin ( ) const | inline |
---|
◆ pack_elements()
Iterator range referencing all of the elements of a template argument pack.
Definition at line 432 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().
◆ pack_end()
◆ pack_size()
unsigned clang::TemplateArgument::pack_size ( ) const | inline |
---|
The number of template arguments in the given template argument pack.
Definition at line 438 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(), CXXNameMangler::TemplateArgManglingInfo::needToMangleTemplateParam(), printTo(), clang::SubstTemplateTypeParmPackType::Profile(), and clang::Sema::SubstituteExplicitTemplateArguments().
◆ print()
void TemplateArgument::print | ( | const PrintingPolicy & | Policy, |
---|---|---|---|
raw_ostream & | Out, | ||
bool | IncludeType | ||
) | const |
Print this template argument to the given output stream.
Definition at line 502 of file TemplateBase.cpp.
References Declaration, Expression, clang::First, getAsDecl(), getAsExpr(), getAsStructuralValue(), getAsTemplate(), getAsTemplateOrTemplatePattern(), getAsType(), getKind(), getParamTypeForDecl(), getStructuralValueType(), Integral, isRecordType(), needsAmpersandOnTemplateArg(), Null, NullPtr, P, Pack, pack_elements(), clang::QualType::print(), clang::TemplateName::print(), printIntegral(), clang::APValue::printPretty(), clang::Stmt::printPretty(), clang::NamedDecl::printQualifiedName(), StructuralValue, clang::PrintingPolicy::SuppressStrongLifetime, Template, TemplateExpansion, and Type.
Referenced by clang::PredefinedExpr::ComputeName(), describeTemplateParameter(), DiagTemplateArg(), clang::TextNodeDumper::dumpTemplateArgument(), clang::Sema::getTemplateArgumentBindingsText(), and printArgument().
◆ Profile()
void TemplateArgument::Profile | ( | llvm::FoldingSetNodeID & | ID, |
---|---|---|---|
const ASTContext & | Context | ||
) | const |
Used to insert TemplateArguments into FoldingSets.
Definition at line 383 of file TemplateBase.cpp.
References Args, Declaration, Expression, getAsDecl(), getAsExpr(), getAsIntegral(), getAsStructuralValue(), getAsType(), getIntegralType(), getKind(), getNullPtrType(), getParamTypeForDecl(), getStructuralValueType(), Integral, Null, NullPtr, Pack, clang::APValue::Profile(), clang::QualType::Profile(), clang::Stmt::Profile(), StructuralValue, Template, TemplateArg, TemplateExpansion, and Type.
Referenced by clang::SubstTemplateTemplateParmPackStorage::Profile(), and clang::DeducedTemplateStorage::Profile().
◆ setIntegralType()
void clang::TemplateArgument::setIntegralType ( QualType T) | inline |
---|
◆ setIsDefaulted()
void clang::TemplateArgument::setIsDefaulted ( bool v) | inline |
---|
◆ structurallyEquals()
Determines whether two template arguments are superficially the same.
Definition at line 431 of file TemplateBase.cpp.
References Args, Declaration, E, Expression, getAsDecl(), getAsIntegral(), getAsStructuralValue(), getIntegralType(), getKind(), getParamTypeForDecl(), getStructuralValueType(), Integral, Null, NullPtr, clang::Other, Pack, clang::APValue::Profile(), StructuralValue, Template, TemplateArg, TemplateExpansion, Type, and TypeOrValue.
Referenced by DeduceTemplateArguments(), clang::TextNodeDumper::dumpTemplateArgument(), clang::ASTContext::getCanonicalTemplateName(), clang::ASTContext::getSubstTemplateTypeParmPackType(), IsStructurallyEquivalent(), and isSubstitutedTemplateArgument().
◆ Args
struct A clang::TemplateArgument::Args
◆ DeclArg
struct DA clang::TemplateArgument::DeclArg
◆ Integer
struct I clang::TemplateArgument::Integer
◆ TemplateArg
struct TA clang::TemplateArgument::TemplateArg
◆ TypeOrValue
struct TV clang::TemplateArgument::TypeOrValue
◆ Value
struct V clang::TemplateArgument::Value
The documentation for this class was generated from the following files:
- include/clang/AST/TemplateBase.h
- lib/AST/ASTDumper.cpp
- lib/AST/TemplateBase.cpp