clang API Documentation

Public Member Functions | Static Public Member Functions | Friends
clang::TemplateTemplateParmDecl Class Reference

#include <DeclTemplate.h>

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

List of all members.

Public Member Functions

bool isParameterPack () const
 Whether this template template parameter is a template parameter pack.
bool isPackExpansion () const
 Whether this parameter pack is a pack expansion.
bool isExpandedParameterPack () const
 Whether this parameter is a template template parameter pack that has a known list of different template parameter lists at different positions.
unsigned getNumExpansionTemplateParameters () const
 Retrieves the number of expansion template parameters in an expanded parameter pack.
TemplateParameterListgetExpansionTemplateParameters (unsigned I) const
 Retrieve a particular expansion type within an expanded parameter pack.
bool hasDefaultArgument () const
 Determine whether this template parameter has a default argument.
const TemplateArgumentLocgetDefaultArgument () const
 Retrieve the default argument, if any.
SourceLocation getDefaultArgumentLoc () const
 Retrieve the location of the default argument, if any.
bool defaultArgumentWasInherited () const
 Determines whether the default argument was inherited from a previous declaration of this template.
void setDefaultArgument (const TemplateArgumentLoc &DefArg, bool Inherited)
 Set the default argument for this template parameter, and whether that default argument was inherited from another declaration.
void removeDefaultArgument ()
 Removes the default argument of this template parameter.
SourceRange getSourceRange () const override LLVM_READONLY
 Source range that this declaration covers.

Static Public Member Functions

static TemplateTemplateParmDeclCreate (const ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D, unsigned P, bool ParameterPack, IdentifierInfo *Id, TemplateParameterList *Params)
static TemplateTemplateParmDeclCreate (const ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D, unsigned P, IdentifierInfo *Id, TemplateParameterList *Params, ArrayRef< TemplateParameterList * > Expansions)
static TemplateTemplateParmDeclCreateDeserialized (ASTContext &C, unsigned ID)
static TemplateTemplateParmDeclCreateDeserialized (ASTContext &C, unsigned ID, unsigned NumExpansions)
static bool classof (const Decl *D)
static bool classofKind (Kind K)

Friends

class ASTDeclReader
class ASTDeclWriter

Detailed Description

TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in

 template <template <typename> class T> class container { };

A template template parameter is a TemplateDecl because it defines the name of a template and the template parameters allowable for substitution.

Definition at line 1214 of file DeclTemplate.h.


Member Function Documentation

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

Reimplemented from clang::TemplateDecl.

Definition at line 1366 of file DeclTemplate.h.

References classofKind(), and clang::Decl::getKind().

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

Reimplemented from clang::TemplateDecl.

Definition at line 1367 of file DeclTemplate.h.

Referenced by classof().

TemplateTemplateParmDecl * TemplateTemplateParmDecl::Create ( const ASTContext C,
DeclContext DC,
SourceLocation  L,
unsigned  D,
unsigned  P,
bool  ParameterPack,
IdentifierInfo Id,
TemplateParameterList Params 
) [static]
TemplateTemplateParmDecl * TemplateTemplateParmDecl::Create ( const ASTContext C,
DeclContext DC,
SourceLocation  L,
unsigned  D,
unsigned  P,
IdentifierInfo Id,
TemplateParameterList Params,
ArrayRef< TemplateParameterList * >  Expansions 
) [static]

Definition at line 632 of file DeclTemplate.cpp.

References AttributeLangSupport::C.

Definition at line 638 of file DeclTemplate.cpp.

References AttributeLangSupport::C.

Determines whether the default argument was inherited from a previous declaration of this template.

Definition at line 1340 of file DeclTemplate.h.

Referenced by getSourceRange(), and clang::ASTDeclWriter::VisitTemplateTemplateParmDecl().

Retrieve the location of the default argument, if any.

Retrieve a particular expansion type within an expanded parameter pack.

Definition at line 1319 of file DeclTemplate.h.

Referenced by clang::Sema::CheckTemplateArgument(), getLVForTemplateParameterList(), and clang::ASTDeclWriter::VisitTemplateTemplateParmDecl().

Retrieves the number of expansion template parameters in an expanded parameter pack.

Definition at line 1312 of file DeclTemplate.h.

Referenced by getLVForTemplateParameterList(), clang::ASTDeclWriter::VisitTemplateTemplateParmDecl(), and clang::ASTDeclReader::VisitTemplateTemplateParmDecl().

SourceRange clang::TemplateTemplateParmDecl::getSourceRange ( ) const [inline, override, virtual]

Whether this parameter is a template template parameter pack that has a known list of different template parameter lists at different positions.

A parameter pack is an expanded parameter pack when the original parameter pack's template parameter list was itself a pack expansion, and that expansion has already been expanded. For exampe, given:

 template<typename...Types> struct Outer {
   template<template<Types> class...Templates> struct Inner;
 };

The parameter pack Templates is a pack expansion, which expands the pack Types. When Types is supplied with template arguments by instantiating Outer, the instantiation of Templates is an expanded parameter pack.

Definition at line 1308 of file DeclTemplate.h.

Referenced by clang::Sema::CheckTemplateArgument(), getLVForTemplateParameterList(), clang::ASTDeclWriter::VisitTemplateTemplateParmDecl(), and clang::ASTDeclReader::VisitTemplateTemplateParmDecl().

Whether this parameter pack is a pack expansion.

A template template parameter pack is a pack expansion if its template parameter list contains an unexpanded parameter pack.

Definition at line 1285 of file DeclTemplate.h.

References clang::TemplateParameterList::containsUnexpandedParameterPack(), and clang::TemplateDecl::getTemplateParameters().

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

Whether this template template parameter is a template parameter pack.

 template<template <class T> ...MetaFunctions> struct Apply;

Reimplemented from clang::Decl.

Definition at line 1279 of file DeclTemplate.h.

Referenced by clang::Sema::CheckTemplateParameterList(), DiagnoseUnexpandedParameterPacks(), GenerateInjectedTemplateArgs(), isSameTemplateParameter(), IsStructurallyEquivalent(), clang::ASTDeclWriter::VisitTemplateTemplateParmDecl(), and clang::ASTNodeImporter::VisitTemplateTemplateParmDecl().

Removes the default argument of this template parameter.

Definition at line 1353 of file DeclTemplate.h.

Referenced by clang::Sema::ActOnClassTemplateSpecialization(), and clang::Sema::CheckTemplateParameterList().

void clang::TemplateTemplateParmDecl::setDefaultArgument ( const TemplateArgumentLoc DefArg,
bool  Inherited 
) [inline]

Set the default argument for this template parameter, and whether that default argument was inherited from another declaration.

Definition at line 1347 of file DeclTemplate.h.

Referenced by clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::CheckTemplateParameterList(), and clang::ASTDeclReader::VisitTemplateTemplateParmDecl().


Friends And Related Function Documentation

friend class ASTDeclReader [friend]

Reimplemented from clang::Decl.

Definition at line 1369 of file DeclTemplate.h.

friend class ASTDeclWriter [friend]

Reimplemented from clang::Decl.

Definition at line 1370 of file DeclTemplate.h.


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