clang 22.0.0git
clang::TemplateIdAnnotation Struct Referencefinal

Information about a template-id annotation token. More...

#include "clang/Sema/ParsedTemplate.h"

Inheritance diagram for clang::TemplateIdAnnotation:
[legend]

Public Member Functions

ParsedTemplateArgumentgetTemplateArgs ()
 Retrieves a pointer to the template arguments.
void Destroy ()
bool mightBeType () const
 Determine whether this might be a type template.
bool hasInvalidName () const
bool hasInvalidArgs () const
bool isInvalid () const

Static Public Member Functions

static TemplateIdAnnotationCreate (SourceLocation TemplateKWLoc, SourceLocation TemplateNameLoc, const IdentifierInfo *Name, OverloadedOperatorKind OperatorKind, ParsedTemplateTy OpaqueTemplateName, TemplateNameKind TemplateKind, SourceLocation LAngleLoc, SourceLocation RAngleLoc, ArrayRef< ParsedTemplateArgument > TemplateArgs, bool ArgsInvalid, SmallVectorImpl< TemplateIdAnnotation * > &CleanupList)
 Creates a new TemplateIdAnnotation with NumArgs arguments and appends it to List.

Public Attributes

friend TrailingObjects
SourceLocation TemplateKWLoc
 TemplateKWLoc - The location of the template keyword.
SourceLocation TemplateNameLoc
 TemplateNameLoc - The location of the template name within the source.
const IdentifierInfoName
 FIXME: Temporarily stores the name of a specialization.
OverloadedOperatorKind Operator
 FIXME: Temporarily stores the overloaded operator kind.
ParsedTemplateTy Template
 The declaration of the template corresponding to the template-name.
TemplateNameKind Kind
 The kind of template that Template refers to.
SourceLocation LAngleLoc
 The location of the '<' before the template argument list.
SourceLocation RAngleLoc
 The location of the '>' after the template argument list.
unsigned NumArgs
 NumArgs - The number of template arguments.
bool ArgsInvalid
 Whether an error was encountered in the template arguments.

Detailed Description

Information about a template-id annotation token.

A template-id annotation token contains the template name, template arguments, and the source locations for important tokens. All of the information about template arguments is allocated directly after this structure. A template-id annotation token can also be generated by a type-constraint construct with no explicit template arguments, e.g. "template<C T>" would annotate C as a TemplateIdAnnotation with no template arguments (the angle locations would be invalid in this case).

Definition at line 156 of file ParsedTemplate.h.

Member Function Documentation

◆ Create()

TemplateIdAnnotation * clang::TemplateIdAnnotation::Create ( SourceLocation TemplateKWLoc,
SourceLocation TemplateNameLoc,
const IdentifierInfo * Name,
OverloadedOperatorKind OperatorKind,
ParsedTemplateTy OpaqueTemplateName,
TemplateNameKind TemplateKind,
SourceLocation LAngleLoc,
SourceLocation RAngleLoc,
ArrayRef< ParsedTemplateArgument > TemplateArgs,
bool ArgsInvalid,
SmallVectorImpl< TemplateIdAnnotation * > & CleanupList )
inlinestatic

Creates a new TemplateIdAnnotation with NumArgs arguments and appends it to List.

Definition at line 204 of file ParsedTemplate.h.

References ArgsInvalid, LAngleLoc, Name, RAngleLoc, TemplateKWLoc, and TemplateNameLoc.

◆ Destroy()

void clang::TemplateIdAnnotation::Destroy ( )
inline

Definition at line 219 of file ParsedTemplate.h.

References getTemplateArgs(), and NumArgs.

◆ getTemplateArgs()

◆ hasInvalidArgs()

bool clang::TemplateIdAnnotation::hasInvalidArgs ( ) const
inline

Definition at line 236 of file ParsedTemplate.h.

References ArgsInvalid.

Referenced by isInvalid().

◆ hasInvalidName()

bool clang::TemplateIdAnnotation::hasInvalidName ( ) const
inline

Definition at line 235 of file ParsedTemplate.h.

References Kind, and clang::TNK_Non_template.

Referenced by isInvalid().

◆ isInvalid()

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

◆ mightBeType()

bool clang::TemplateIdAnnotation::mightBeType ( ) const
inline

Determine whether this might be a type template.

Definition at line 228 of file ParsedTemplate.h.

References Kind, clang::TNK_Dependent_template_name, clang::TNK_Non_template, clang::TNK_Type_template, and clang::TNK_Undeclared_template.

Referenced by clang::Parser::TryAnnotateTypeOrScopeToken().

Member Data Documentation

◆ ArgsInvalid

bool clang::TemplateIdAnnotation::ArgsInvalid

Whether an error was encountered in the template arguments.

If so, NumArgs and the trailing arguments are best-effort.

Definition at line 196 of file ParsedTemplate.h.

Referenced by Create(), and hasInvalidArgs().

◆ Kind

TemplateNameKind clang::TemplateIdAnnotation::Kind

The kind of template that Template refers to.

If this is TNK_Non_template, an error was encountered and diagnosed when parsing or looking up the template name.

Definition at line 181 of file ParsedTemplate.h.

Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnIdExpression(), hasInvalidName(), mightBeType(), and clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec().

◆ LAngleLoc

◆ Name

◆ NumArgs

◆ Operator

OverloadedOperatorKind clang::TemplateIdAnnotation::Operator

FIXME: Temporarily stores the overloaded operator kind.

Definition at line 172 of file ParsedTemplate.h.

◆ RAngleLoc

◆ Template

◆ TemplateKWLoc

SourceLocation clang::TemplateIdAnnotation::TemplateKWLoc

◆ TemplateNameLoc

◆ TrailingObjects

friend clang::TemplateIdAnnotation::TrailingObjects

Definition at line 159 of file ParsedTemplate.h.


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