struct TemplateIdAnnotation

Declaration

struct TemplateIdAnnotation : private TrailingObjects { /* full declaration omitted */ };

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).

Declared at: clang/include/clang/Sema/ParsedTemplate.h:149

Inherits from: TrailingObjects

Member Variables

public clang::SourceLocation TemplateKWLoc
TemplateKWLoc - The location of the template keyword. For e.g. typename T::template Y <U >
public clang::SourceLocation TemplateNameLoc
TemplateNameLoc - The location of the template name within the source.
public clang::IdentifierInfo* Name
FIXME: Temporarily stores the name of a specialization
public clang::OverloadedOperatorKind Operator
FIXME: Temporarily stores the overloaded operator kind.
public clang::ParsedTemplateTy Template
The declaration of the template corresponding to the template-name.
public clang::TemplateNameKind 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.
public clang::SourceLocation LAngleLoc
The location of the ' < ' before the template argument list.
public clang::SourceLocation RAngleLoc
The location of the '>' after the template argument list.
public unsigned int NumArgs
NumArgs - The number of template arguments.
public bool ArgsInvalid
Whether an error was encountered in the template arguments. If so, NumArgs and the trailing arguments are best-effort.

Method Overview

  • public static clang::TemplateIdAnnotation * Create(clang::SourceLocation TemplateKWLoc, clang::SourceLocation TemplateNameLoc, clang::IdentifierInfo * Name, clang::OverloadedOperatorKind OperatorKind, clang::ParsedTemplateTy OpaqueTemplateName, clang::TemplateNameKind TemplateKind, clang::SourceLocation LAngleLoc, clang::SourceLocation RAngleLoc, ArrayRef<clang::ParsedTemplateArgument> TemplateArgs, bool ArgsInvalid, SmallVectorImpl<clang::TemplateIdAnnotation *> & CleanupList)
  • public void Destroy()
  • private TemplateIdAnnotation(const clang::TemplateIdAnnotation &)
  • private TemplateIdAnnotation(clang::SourceLocation TemplateKWLoc, clang::SourceLocation TemplateNameLoc, clang::IdentifierInfo * Name, clang::OverloadedOperatorKind OperatorKind, clang::ParsedTemplateTy OpaqueTemplateName, clang::TemplateNameKind TemplateKind, clang::SourceLocation LAngleLoc, clang::SourceLocation RAngleLoc, ArrayRef<clang::ParsedTemplateArgument> TemplateArgs, bool ArgsInvalid) noexcept
  • public clang::ParsedTemplateArgument * getTemplateArgs()
  • public bool hasInvalidArgs() const
  • public bool hasInvalidName() const
  • public bool isInvalid() const
  • public bool mightBeType() const
  • private ~TemplateIdAnnotation()

Methods

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

Description

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

Declared at: clang/include/clang/Sema/ParsedTemplate.h:199

Parameters

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

void Destroy()

Declared at: clang/include/clang/Sema/ParsedTemplate.h:214

TemplateIdAnnotation(
    const clang::TemplateIdAnnotation&)

Declared at: clang/include/clang/Sema/ParsedTemplate.h:236

Parameters

const clang::TemplateIdAnnotation&

TemplateIdAnnotation(
    clang::SourceLocation TemplateKWLoc,
    clang::SourceLocation TemplateNameLoc,
    clang::IdentifierInfo* Name,
    clang::OverloadedOperatorKind OperatorKind,
    clang::ParsedTemplateTy OpaqueTemplateName,
    clang::TemplateNameKind TemplateKind,
    clang::SourceLocation LAngleLoc,
    clang::SourceLocation RAngleLoc,
    ArrayRef<clang::ParsedTemplateArgument>
        TemplateArgs,
    bool ArgsInvalid) noexcept

Declared at: clang/include/clang/Sema/ParsedTemplate.h:238

Parameters

clang::SourceLocation TemplateKWLoc
clang::SourceLocation TemplateNameLoc
clang::IdentifierInfo* Name
clang::OverloadedOperatorKind OperatorKind
clang::ParsedTemplateTy OpaqueTemplateName
clang::TemplateNameKind TemplateKind
clang::SourceLocation LAngleLoc
clang::SourceLocation RAngleLoc
ArrayRef<clang::ParsedTemplateArgument> TemplateArgs
bool ArgsInvalid

clang::ParsedTemplateArgument* getTemplateArgs()

Description

Retrieves a pointer to the template arguments

Declared at: clang/include/clang/Sema/ParsedTemplate.h:192

bool hasInvalidArgs() const

Declared at: clang/include/clang/Sema/ParsedTemplate.h:231

bool hasInvalidName() const

Declared at: clang/include/clang/Sema/ParsedTemplate.h:230

bool isInvalid() const

Declared at: clang/include/clang/Sema/ParsedTemplate.h:233

bool mightBeType() const

Description

Determine whether this might be a type template.

Declared at: clang/include/clang/Sema/ParsedTemplate.h:223

~TemplateIdAnnotation()

Declared at: clang/include/clang/Sema/ParsedTemplate.h:254