clang  3.9.0svn
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Friends
clang::TypeAliasTemplateDecl Class Reference

Declaration of an alias template. More...

#include <DeclTemplate.h>

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

List of all members.

Public Member Functions

TypeAliasDeclgetTemplatedDecl () const
 Get the underlying function declaration of the template.
TypeAliasTemplateDeclgetCanonicalDecl () override
 Retrieves the canonical declaration of this template.
const TypeAliasTemplateDeclgetCanonicalDecl () const
TypeAliasTemplateDeclgetPreviousDecl ()
 Retrieve the previous declaration of this function template, or NULL if no such declaration exists.
const TypeAliasTemplateDeclgetPreviousDecl () const
 Retrieve the previous declaration of this function template, or NULL if no such declaration exists.
TypeAliasTemplateDeclgetInstantiatedFromMemberTemplate () const
 Retrieve the member template from which this template was instantiated, or NULL if this template was not instantiated from a member template.

Static Public Member Functions

static TypeAliasTemplateDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl)
 Create a function template node.
static TypeAliasTemplateDeclCreateDeserialized (ASTContext &C, unsigned ID)
 Create an empty alias template node.
static bool classof (const Decl *D)
static bool classofKind (Kind K)

Protected Types

typedef CommonBase Common
 Pointer to the common data shared by all declarations of this template.

Protected Member Functions

 TypeAliasTemplateDecl (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl)
CommonBasenewCommon (ASTContext &C) const override
CommongetCommonPtr ()

Friends

class ASTDeclReader
class ASTDeclWriter

Detailed Description

Declaration of an alias template.

For example:

 template \<typename T> using V = std::map<T*, int, MyCompare<T>>;

Definition at line 2236 of file DeclTemplate.h.


Member Typedef Documentation

Pointer to the common data shared by all declarations of this template.

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2240 of file DeclTemplate.h.


Constructor & Destructor Documentation

clang::TypeAliasTemplateDecl::TypeAliasTemplateDecl ( ASTContext C,
DeclContext DC,
SourceLocation  L,
DeclarationName  Name,
TemplateParameterList *  Params,
NamedDecl Decl 
) [inline, protected]

Definition at line 2242 of file DeclTemplate.h.

Referenced by Create(), and CreateDeserialized().


Member Function Documentation

static bool clang::TypeAliasTemplateDecl::classof ( const Decl D) [inline, static]

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2302 of file DeclTemplate.h.

References clang::Decl::getKind().

static bool clang::TypeAliasTemplateDecl::classofKind ( Kind  K) [inline, static]

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2303 of file DeclTemplate.h.

TypeAliasTemplateDecl * TypeAliasTemplateDecl::Create ( ASTContext C,
DeclContext DC,
SourceLocation  L,
DeclarationName  Name,
TemplateParameterList *  Params,
NamedDecl Decl 
) [static]

Create a function template node.

Definition at line 924 of file DeclTemplate.cpp.

References AdoptTemplateParameterList(), AttributeLangSupport::C, and TypeAliasTemplateDecl().

TypeAliasTemplateDecl * TypeAliasTemplateDecl::CreateDeserialized ( ASTContext C,
unsigned  ID 
) [static]

Create an empty alias template node.

Definition at line 934 of file DeclTemplate.cpp.

References AttributeLangSupport::C, and TypeAliasTemplateDecl().

TypeAliasTemplateDecl* clang::TypeAliasTemplateDecl::getCanonicalDecl ( ) [inline, override, virtual]

Retrieves the canonical declaration of this template.

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2261 of file DeclTemplate.h.

References getCanonicalDecl().

const TypeAliasTemplateDecl* clang::TypeAliasTemplateDecl::getCanonicalDecl ( ) const [inline]

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2265 of file DeclTemplate.h.

References getCanonicalDecl().

Common* clang::TypeAliasTemplateDecl::getCommonPtr ( ) [inline, protected]

Definition at line 2250 of file DeclTemplate.h.

References clang::RedeclarableTemplateDecl::getCommonPtr().

TypeAliasTemplateDecl* clang::TypeAliasTemplateDecl::getInstantiatedFromMemberTemplate ( ) const [inline]

Retrieve the member template from which this template was instantiated, or NULL if this template was not instantiated from a member template.

A template is instantiated from a member template when the member template itself is part of a class template (or member thereof). For example, given

 template<typename T>
 struct X {
   template<typename U> void f(T, U);
 };

 void test(X<int> x) {
   x.f(1, 'a');
 };

X<int>::f is a FunctionTemplateDecl that describes the function template

 template<typename U> void X<int>::f(int, U);

which was itself created during the instantiation of X<int>. Calling getInstantiatedFromMemberTemplate() on this FunctionTemplateDecl will retrieve the FunctionTemplateDecl for the original template f within the class template X<T>, i.e.,

 template<typename T>
 template<typename U>
 void X<T>::f(T, U);

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2285 of file DeclTemplate.h.

References clang::RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate().

TypeAliasTemplateDecl* clang::TypeAliasTemplateDecl::getPreviousDecl ( ) [inline]

Retrieve the previous declaration of this function template, or NULL if no such declaration exists.

Reimplemented from clang::Redeclarable< RedeclarableTemplateDecl >.

Definition at line 2272 of file DeclTemplate.h.

const TypeAliasTemplateDecl* clang::TypeAliasTemplateDecl::getPreviousDecl ( ) const [inline]

Retrieve the previous declaration of this function template, or NULL if no such declaration exists.

Reimplemented from clang::Redeclarable< RedeclarableTemplateDecl >.

Definition at line 2279 of file DeclTemplate.h.

TypeAliasDecl* clang::TypeAliasTemplateDecl::getTemplatedDecl ( ) const [inline]

Get the underlying function declaration of the template.

Reimplemented from clang::TemplateDecl.

Definition at line 2256 of file DeclTemplate.h.

Referenced by clang::Sema::ActOnAliasDeclaration().

RedeclarableTemplateDecl::CommonBase * TypeAliasTemplateDecl::newCommon ( ASTContext C) const [override, protected, virtual]

Friends And Related Function Documentation

friend class ASTDeclReader [friend]

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2305 of file DeclTemplate.h.

friend class ASTDeclWriter [friend]

Reimplemented from clang::RedeclarableTemplateDecl.

Definition at line 2306 of file DeclTemplate.h.


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