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

Represents the parsed form of a C++ template argument. More...

#include "clang/Sema/ParsedTemplate.h"

Public Types

enum  KindType { Type, NonType, Template }
 Describes the kind of template argument that was parsed. More...
 

Public Member Functions

 ParsedTemplateArgument ()
 Build an empty template argument. More...
 
 ParsedTemplateArgument (KindType Kind, void *Arg, SourceLocation Loc)
 Create a template type argument or non-type template argument. More...
 
 ParsedTemplateArgument (const CXXScopeSpec &SS, ParsedTemplateTy Template, SourceLocation TemplateLoc)
 Create a template template argument. More...
 
bool isInvalid () const
 Determine whether the given template argument is invalid. More...
 
KindType getKind () const
 Determine what kind of template argument we have. More...
 
ParsedType getAsType () const
 Retrieve the template type argument's type. More...
 
ExprgetAsExpr () const
 Retrieve the non-type template argument's expression. More...
 
ParsedTemplateTy getAsTemplate () const
 Retrieve the template template argument's template name. More...
 
SourceLocation getLocation () const
 Retrieve the location of the template argument. More...
 
const CXXScopeSpecgetScopeSpec () const
 Retrieve the nested-name-specifier that precedes the template name in a template template argument. More...
 
SourceLocation getEllipsisLoc () const
 Retrieve the location of the ellipsis that makes a template template argument into a pack expansion. More...
 
ParsedTemplateArgument getTemplatePackExpansion (SourceLocation EllipsisLoc) const
 Retrieve a pack expansion of the given template template argument. More...
 

Detailed Description

Represents the parsed form of a C++ template argument.

Definition at line 30 of file ParsedTemplate.h.

Member Enumeration Documentation

◆ KindType

Describes the kind of template argument that was parsed.

Enumerator
Type 

A template type parameter, stored as a type.

NonType 

A non-type template parameter, stored as an expression.

Template 

A template template argument, stored as a template name.

Definition at line 33 of file ParsedTemplate.h.

Constructor & Destructor Documentation

◆ ParsedTemplateArgument() [1/3]

clang::ParsedTemplateArgument::ParsedTemplateArgument ( )
inline

Build an empty template argument.

This template argument is invalid.

Definition at line 45 of file ParsedTemplate.h.

◆ ParsedTemplateArgument() [2/3]

clang::ParsedTemplateArgument::ParsedTemplateArgument ( KindType  Kind,
void *  Arg,
SourceLocation  Loc 
)
inline

Create a template type argument or non-type template argument.

Parameters
Argthe template type argument or non-type template argument.
Locthe location of the type.

Definition at line 51 of file ParsedTemplate.h.

◆ ParsedTemplateArgument() [3/3]

clang::ParsedTemplateArgument::ParsedTemplateArgument ( const CXXScopeSpec SS,
ParsedTemplateTy  Template,
SourceLocation  TemplateLoc 
)
inline

Create a template template argument.

Parameters
SSthe C++ scope specifier that precedes the template name, if any.
Templatethe template to which this template template argument refers.
TemplateLocthe location of the template name.

Definition at line 63 of file ParsedTemplate.h.

Member Function Documentation

◆ getAsExpr()

Expr* clang::ParsedTemplateArgument::getAsExpr ( ) const
inline

Retrieve the non-type template argument's expression.

Definition at line 83 of file ParsedTemplate.h.

References NonType.

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

◆ getAsTemplate()

ParsedTemplateTy clang::ParsedTemplateArgument::getAsTemplate ( ) const
inline

Retrieve the template template argument's template name.

Definition at line 89 of file ParsedTemplate.h.

References clang::OpaquePtr< TemplateName >::getFromOpaquePtr(), and Template.

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

◆ getAsType()

ParsedType clang::ParsedTemplateArgument::getAsType ( ) const
inline

Retrieve the template type argument's type.

Definition at line 77 of file ParsedTemplate.h.

References clang::OpaquePtr< QualType >::getFromOpaquePtr().

Referenced by clang::Sema::ActOnPackExpansion(), and translateTemplateArgument().

◆ getEllipsisLoc()

SourceLocation clang::ParsedTemplateArgument::getEllipsisLoc ( ) const
inline

Retrieve the location of the ellipsis that makes a template template argument into a pack expansion.

Definition at line 107 of file ParsedTemplate.h.

References getTemplatePackExpansion(), and Template.

◆ getKind()

KindType clang::ParsedTemplateArgument::getKind ( ) const
inline

Determine what kind of template argument we have.

Definition at line 74 of file ParsedTemplate.h.

Referenced by clang::Sema::ActOnPackExpansion(), and translateTemplateArgument().

◆ getLocation()

SourceLocation clang::ParsedTemplateArgument::getLocation ( ) const
inline

Retrieve the location of the template argument.

Definition at line 95 of file ParsedTemplate.h.

Referenced by clang::Sema::ActOnPackExpansion(), and translateTemplateArgument().

◆ getScopeSpec()

const CXXScopeSpec& clang::ParsedTemplateArgument::getScopeSpec ( ) const
inline

Retrieve the nested-name-specifier that precedes the template name in a template template argument.

Definition at line 99 of file ParsedTemplate.h.

References Template.

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

◆ getTemplatePackExpansion()

ParsedTemplateArgument ParsedTemplateArgument::getTemplatePackExpansion ( SourceLocation  EllipsisLoc) const

Retrieve a pack expansion of the given template template argument.

Parameters
EllipsisLocThe location of the ellipsis.

Definition at line 722 of file SemaTemplate.cpp.

Referenced by clang::Sema::ActOnPackExpansion(), and getEllipsisLoc().

◆ isInvalid()

bool clang::ParsedTemplateArgument::isInvalid ( ) const
inline

Determine whether the given template argument is invalid.

Definition at line 71 of file ParsedTemplate.h.

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


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