clang  6.0.0svn
Public Member Functions | List of all members
clang::DeducedTemplateArgument Class Reference

Captures a template argument whose value has been deduced via c++ template argument deduction. More...

#include "clang/Sema/Template.h"

Inheritance diagram for clang::DeducedTemplateArgument:
Inheritance graph
[legend]
Collaboration diagram for clang::DeducedTemplateArgument:
Collaboration graph
[legend]

Public Member Functions

 DeducedTemplateArgument ()
 
 DeducedTemplateArgument (const TemplateArgument &Arg, bool DeducedFromArrayBound=false)
 
 DeducedTemplateArgument (ASTContext &Ctx, const llvm::APSInt &Value, QualType ValueType, bool DeducedFromArrayBound)
 Construct an integral non-type template argument that has been deduced, possibly from an array bound. More...
 
bool wasDeducedFromArrayBound () const
 For a non-type template argument, determine whether the template argument was deduced from an array bound. More...
 
void setDeducedFromArrayBound (bool Deduced)
 Specify whether the given non-type template argument was deduced from an array bound. More...
 
- Public Member Functions inherited from clang::TemplateArgument
constexpr TemplateArgument ()
 Construct an empty, invalid template argument. More...
 
 TemplateArgument (QualType T, bool isNullPtr=false)
 Construct a template type argument. More...
 
 TemplateArgument (ValueDecl *D, QualType QT)
 Construct a template argument that refers to a declaration, which is either an external declaration or a template declaration. More...
 
 TemplateArgument (ASTContext &Ctx, const llvm::APSInt &Value, QualType Type)
 Construct an integral constant template argument. More...
 
 TemplateArgument (const TemplateArgument &Other, QualType Type)
 Construct an integral constant template argument with the same value as Other but a different type. More...
 
 TemplateArgument (TemplateName Name)
 Construct a template argument that is a template. More...
 
 TemplateArgument (TemplateName Name, Optional< unsigned > NumExpansions)
 Construct a template argument that is a template pack expansion. More...
 
 TemplateArgument (Expr *E)
 Construct a template argument that is an expression. More...
 
 TemplateArgument (ArrayRef< TemplateArgument > Args)
 Construct a template argument that is a template argument pack. More...
 
ArgKind getKind () const
 Return the kind of stored template argument. More...
 
bool isNull () const
 Determine whether this template argument has no value. More...
 
bool isDependent () const
 Whether this template argument is dependent on a template parameter such that its result can change from one instantiation to another. More...
 
bool isInstantiationDependent () const
 Whether this template argument is dependent on a template parameter. More...
 
bool containsUnexpandedParameterPack () const
 Whether this template argument contains an unexpanded parameter pack. More...
 
bool isPackExpansion () const
 Determine whether this template argument is a pack expansion. More...
 
QualType getAsType () const
 Retrieve the type for a type template argument. More...
 
ValueDeclgetAsDecl () const
 Retrieve the declaration for a declaration non-type template argument. More...
 
QualType getParamTypeForDecl () const
 
QualType getNullPtrType () const
 Retrieve the type for null non-type template argument. More...
 
TemplateName getAsTemplate () const
 Retrieve the template name for a template name argument. More...
 
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. More...
 
Optional< unsigned > getNumTemplateExpansions () const
 Retrieve the number of expansions that a template template argument expansion will produce, if known. More...
 
llvm::APSInt getAsIntegral () const
 Retrieve the template argument as an integral value. More...
 
QualType getIntegralType () const
 Retrieve the type of the integral value. More...
 
void setIntegralType (QualType T)
 
QualType getNonTypeTemplateArgumentType () const
 If this is a non-type template argument, get its type. More...
 
ExprgetAsExpr () const
 Retrieve the template argument as an expression. More...
 
pack_iterator pack_begin () const
 Iterator referencing the first argument of a template argument pack. More...
 
pack_iterator pack_end () const
 Iterator referencing one past the last argument of a template argument pack. More...
 
ArrayRef< TemplateArgumentpack_elements () const
 Iterator range referencing all of the elements of a template argument pack. More...
 
unsigned pack_size () const
 The number of template arguments in the given template argument pack. More...
 
ArrayRef< TemplateArgumentgetPackAsArray () const
 Return the array of arguments in this template argument pack. More...
 
bool structurallyEquals (const TemplateArgument &Other) const
 Determines whether two template arguments are superficially the same. More...
 
TemplateArgument getPackExpansionPattern () const
 When the template argument is a pack expansion, returns the pattern of the pack expansion. More...
 
void print (const PrintingPolicy &Policy, raw_ostream &Out) const
 Print this template argument to the given output stream. More...
 
void dump (raw_ostream &Out) const
 Debugging aid that dumps the template argument. More...
 
void dump () const
 Debugging aid that dumps the template argument to standard error. More...
 
void Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context) const
 Used to insert TemplateArguments into FoldingSets. More...
 

Additional Inherited Members

- Public Types inherited from clang::TemplateArgument
enum  ArgKind {
  Null = 0, Type, Declaration, NullPtr,
  Integral, Template, TemplateExpansion, Expression,
  Pack
}
 The kind of template argument we're storing. More...
 
typedef const TemplateArgumentpack_iterator
 Iterator that traverses the elements of a template argument pack. More...
 
- Static Public Member Functions inherited from clang::TemplateArgument
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. More...
 

Detailed Description

Captures a template argument whose value has been deduced via c++ template argument deduction.

Definition at line 163 of file Template.h.

Constructor & Destructor Documentation

◆ DeducedTemplateArgument() [1/3]

clang::DeducedTemplateArgument::DeducedTemplateArgument ( )
inline

Definition at line 169 of file Template.h.

◆ DeducedTemplateArgument() [2/3]

clang::DeducedTemplateArgument::DeducedTemplateArgument ( const TemplateArgument Arg,
bool  DeducedFromArrayBound = false 
)
inline

Definition at line 172 of file Template.h.

◆ DeducedTemplateArgument() [3/3]

clang::DeducedTemplateArgument::DeducedTemplateArgument ( ASTContext Ctx,
const llvm::APSInt &  Value,
QualType  ValueType,
bool  DeducedFromArrayBound 
)
inline

Construct an integral non-type template argument that has been deduced, possibly from an array bound.

Definition at line 178 of file Template.h.

Member Function Documentation

◆ setDeducedFromArrayBound()

void clang::DeducedTemplateArgument::setDeducedFromArrayBound ( bool  Deduced)
inline

Specify whether the given non-type template argument was deduced from an array bound.

Definition at line 191 of file Template.h.

Referenced by ConvertDeducedTemplateArgument().

◆ wasDeducedFromArrayBound()

bool clang::DeducedTemplateArgument::wasDeducedFromArrayBound ( ) const
inline

For a non-type template argument, determine whether the template argument was deduced from an array bound.

Definition at line 187 of file Template.h.

Referenced by ConvertDeducedTemplateArgument(), and DeduceNonTypeTemplateArgument().


The documentation for this class was generated from the following file: