clang 20.0.0git
|
Represents a C++ template name within the type system. More...
#include "clang/AST/TemplateName.h"
Public Types | |
enum | NameKind { Template , OverloadedTemplate , AssumedTemplate , QualifiedTemplate , DependentTemplate , SubstTemplateTemplateParm , SubstTemplateTemplateParmPack , UsingTemplate , DeducedTemplate } |
enum class | Qualified { None , AsWritten } |
Public Member Functions | |
TemplateName ()=default | |
TemplateName (TemplateDecl *Template) | |
TemplateName (OverloadedTemplateStorage *Storage) | |
TemplateName (AssumedTemplateStorage *Storage) | |
TemplateName (SubstTemplateTemplateParmStorage *Storage) | |
TemplateName (SubstTemplateTemplateParmPackStorage *Storage) | |
TemplateName (QualifiedTemplateName *Qual) | |
TemplateName (DependentTemplateName *Dep) | |
TemplateName (UsingShadowDecl *Using) | |
TemplateName (DeducedTemplateStorage *Deduced) | |
bool | isNull () const |
Determine whether this template name is NULL. | |
NameKind | getKind () const |
TemplateDecl * | getAsTemplateDecl (bool IgnoreDeduced=false) const |
Retrieve the underlying template declaration that this template name refers to, if known. | |
std::pair< TemplateDecl *, DefaultArguments > | getTemplateDeclAndDefaultArgs () const |
Retrieves the underlying template declaration that this template name refers to, along with the deduced default arguments, if any. | |
OverloadedTemplateStorage * | getAsOverloadedTemplate () const |
Retrieve the underlying, overloaded function template declarations that this template name refers to, if known. | |
AssumedTemplateStorage * | getAsAssumedTemplateName () const |
Retrieve information on a name that has been assumed to be a template-name in order to permit a call via ADL. | |
SubstTemplateTemplateParmStorage * | getAsSubstTemplateTemplateParm () const |
Retrieve the substituted template template parameter, if known. | |
SubstTemplateTemplateParmPackStorage * | getAsSubstTemplateTemplateParmPack () const |
Retrieve the substituted template template parameter pack, if known. | |
QualifiedTemplateName * | getAsQualifiedTemplateName () const |
Retrieve the underlying qualified template name structure, if any. | |
DependentTemplateName * | getAsDependentTemplateName () const |
Retrieve the underlying dependent template name structure, if any. | |
UsingShadowDecl * | getAsUsingShadowDecl () const |
Retrieve the using shadow declaration through which the underlying template declaration is introduced, if any. | |
DeducedTemplateStorage * | getAsDeducedTemplateName () const |
Retrieve the deduced template info, if any. | |
std::optional< TemplateName > | desugar (bool IgnoreDeduced) const |
TemplateName | getUnderlying () const |
TemplateNameDependence | getDependence () const |
bool | isDependent () const |
Determines whether this is a dependent template name. | |
bool | isInstantiationDependent () const |
Determines whether this is a template name that somehow depends on a template parameter. | |
bool | containsUnexpandedParameterPack () const |
Determines whether this template name contains an unexpanded parameter pack (for C++0x variadic templates). | |
void | print (raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const |
Print the template name. | |
void | dump (raw_ostream &OS, const ASTContext &Context) const |
Debugging aid that dumps the template name. | |
void | dump () const |
Debugging aid that dumps the template name to standard error. | |
void | Profile (llvm::FoldingSetNodeID &ID) |
void * | getAsVoidPointer () const |
Retrieve the template name as a void pointer. | |
bool | operator== (TemplateName Other) const |
Structural equality. | |
bool | operator!= (TemplateName Other) const |
Static Public Member Functions | |
static TemplateName | getFromVoidPointer (void *Ptr) |
Build a template name from a void pointer. | |
Represents a C++ template name within the type system.
A C++ template name refers to a template within the C++ type system. In most cases, a template name is simply a reference to a class template, e.g.
Here, the 'X' in X<int>
is a template name that refers to the declaration of the class template X, above. Template names can also refer to function templates, C++0x template aliases, etc.
Some template names are dependent. For example, consider:
Here, "apply" is treated as a template name within the typename specifier in the typedef. "apply" is a nested template, and can only be understood in the context of a template instantiation, hence is represented as a dependent template name.
Definition at line 220 of file TemplateName.h.
Enumerator | |
---|---|
Template | A single template declaration. |
OverloadedTemplate | A set of overloaded template declarations. |
AssumedTemplate | An unqualified-id that has been assumed to name a function template that will be found by ADL. |
QualifiedTemplate | A qualified template name, where the qualification is kept to describe the source code as written. |
DependentTemplate | A dependent template name that has not been resolved to a template (or set of templates). |
SubstTemplateTemplateParm | A template template parameter that has been substituted for some other template name. |
SubstTemplateTemplateParmPack | A template template parameter pack that has been substituted for a template template argument pack, but has not yet been expanded into individual arguments. |
UsingTemplate | A template name that refers to a template declaration found through a specific using shadow declaration. |
DeducedTemplate | A template name that refers to another TemplateName with deduced default arguments. |
Definition at line 235 of file TemplateName.h.
|
strong |
Enumerator | |
---|---|
None | |
AsWritten |
Definition at line 364 of file TemplateName.h.
|
default |
Referenced by desugar().
|
explicit |
Definition at line