clang 8.0.0

Classes | Public Member Functions | Public Attributes | List of all members
clang::UnqualifiedId Class Reference

Represents a C++ unqualified-id that has been parsed. More...

`#include "clang/Sema/DeclSpec.h"`

Collaboration diagram for clang::UnqualifiedId:
[legend]

## Classes
struct | OFI

## Public Member Functions
| UnqualifiedId ()
void | clear ()
| Clear out this unqualified-id, setting it to default (invalid) state. More...
bool | isValid () const
| Determine whether this unqualified-id refers to a valid name. More...
bool | isInvalid () const
| Determine whether this unqualified-id refers to an invalid name. More...
UnqualifiedIdKind | getKind () const
| Determine what kind of name we have. More...
void | setKind (UnqualifiedIdKind kind)
void | setIdentifier (const IdentifierInfo *Id, SourceLocation IdLoc)
| Specify that this unqualified-id was parsed as an identifier. More...
void | setOperatorFunctionId (SourceLocation OperatorLoc, OverloadedOperatorKind Op, SourceLocation SymbolLocations[3])
| Specify that this unqualified-id was parsed as an operator-function-id. More...
void | setConversionFunctionId (SourceLocation OperatorLoc, ParsedType Ty, SourceLocation EndLoc)
| Specify that this unqualified-id was parsed as a conversion-function-id. More...
void | setLiteralOperatorId (const IdentifierInfo *Id, SourceLocation OpLoc, SourceLocation IdLoc)
| Specific that this unqualified-id was parsed as a literal-operator-id. More...
void | setConstructorName (ParsedType ClassType, SourceLocation ClassNameLoc, SourceLocation EndLoc)
| Specify that this unqualified-id was parsed as a constructor name. More...
void | setConstructorTemplateId (TemplateIdAnnotation *TemplateId)
| Specify that this unqualified-id was parsed as a template-id that names a constructor. More...
void | setDestructorName (SourceLocation TildeLoc, ParsedType ClassType, SourceLocation EndLoc)
| Specify that this unqualified-id was parsed as a destructor name. More...
void | setTemplateId (TemplateIdAnnotation *TemplateId)
| Specify that this unqualified-id was parsed as a template-id. More...
void | setDeductionGuideName (ParsedTemplateTy Template, SourceLocation TemplateLoc)
| Specify that this unqualified-id was parsed as a template-name for a deduction-guide. More...
SourceRange | getSourceRange () const LLVM_READONLY
| Return the source range that covers this unqualified-id. More...
SourceLocation | getBeginLoc () const LLVM_READONLY
SourceLocation | getEndLoc () const LLVM_READONLY

## Public Attributes
UnqualifiedIdKind | Kind
| Describes the kind of unqualified-id parsed. More...
union {
IdentifierInfo * Identifier
| When Kind == IK_Identifier, the parsed identifier, or when Kind == IK_UserLiteralId, the identifier suffix. More...
struct OFI OperatorFunctionId
| When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed. More...
UnionParsedType ConversionFunctionId
| When Kind == IK_ConversionFunctionId, the type that the conversion function names. More...
UnionParsedType ConstructorName
| When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced. More...
UnionParsedType DestructorName
| When Kind == IK_DestructorName, the type referred to by the class-name. More...
UnionParsedTemplateTy TemplateName
| When Kind == IK_DeductionGuideName, the parsed template-name. More...
TemplateIdAnnotation * TemplateId
| When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the template name and template arguments. More...
}; |
| Anonymous union that holds extra data associated with the parsed unqualified-id. More...
SourceLocation | StartLocation
| The location of the first token that describes this unqualified-id, which will be the location of the identifier, "operator" keyword, tilde (for a destructor), or the template name of a template-id. More...
SourceLocation | EndLocation
| The location of the last token that describes this unqualified-id. More...

## Detailed Description

Represents a C++ unqualified-id that has been parsed.

Definition at line 934 of file DeclSpec.h.

## Constructor & Destructor Documentation

## ◆ UnqualifiedId()

clang::UnqualifiedId::UnqualifiedId | ( |  | ) |
| inline

Definition at line 997 of file DeclSpec.h.

## Member Function Documentation

## ◆ clear()

void clang::UnqualifiedId::clear | ( |  | ) |
| inline

Clear out this unqualified-id, setting it to default (invalid) state.

Definition at line 1002 of file DeclSpec.h.

References Identifier, and clang::IK_Identifier.

Referenced by clang::Declarator::clear().

## ◆ getBeginLoc()

SourceLocation clang::UnqualifiedId::getBeginLoc | ( |  | ) | const
| inline

Definition at line 1137 of file DeclSpec.h.

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

## ◆ getEndLoc()

SourceLocation clang::UnqualifiedId::getEndLoc | ( |  | ) | const
| inline

Definition at line 1138 of file DeclSpec.h.

## ◆ getKind()

UnqualifiedIdKind clang::UnqualifiedId::getKind | ( |  | ) | const
| inline

Determine what kind of name we have.

Definition at line 1016 of file DeclSpec.h.

Referenced by clang::Sema::ActOnMemberAccessExpr(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::DecomposeUnqualifiedId(), diagnoseRedundantReturnTypeQualifiers(), GetDeclSpecTypeForDeclarator(), clang::Declarator::getIdentifier(), clang::Declarator::hasName(), clang::Declarator::isCtorOrDtor(), clang::Declarator::mayBeFollowedByCXXDirectInit(), and clang::Parser::ParseUnqualifiedId().

## ◆ getSourceRange()

SourceRange clang::UnqualifiedId::getSourceRange | ( |  | ) | const
| inline

Return the source range that covers this unqualified-id.

Definition at line 1134 of file DeclSpec.h.

Referenced by clang::Sema::ActOnMemberAccessExpr(), clang::Sema::CheckConversionDeclarator(), GetDeclSpecTypeForDeclarator(), and getMissingDeclaratorIdLoc().

## ◆ isInvalid()

bool clang::UnqualifiedId::isInvalid | ( |  | ) | const
| inline

Determine whether this unqualified-id refers to an invalid name.

Definition at line 1013 of file DeclSpec.h.

References clang::CXXScopeSpec::isValid().

## ◆ isValid()

bool clang::UnqualifiedId::isValid | ( |  | ) | const
| inline

Determine whether this unqualified-id refers to a valid name.

Definition at line 1010 of file DeclSpec.h.

References clang::SourceLocation::isValid().

Referenced by addConstexprToLambdaDeclSpecifier(), clang::Declarator::isPastIdentifier(), and setOperatorFunctionId().

## ◆ setConstructorName()

void clang::UnqualifiedId::setConstructorName | ( | ParsedType | ClassType,
|  | SourceLocation | ClassNameLoc,
|  | SourceLocation | EndLoc
| ) |  |
| inline

Specify that this unqualified-id was parsed as a constructor name.

Parameters

  ClassType | the class type referred to by the constructor name.
  ClassNameLoc | the location of the class name.
  EndLoc | the location of the last token that makes up the type name.

Definition at line 1082 of file DeclSpec.h.

References clang::IK_ConstructorName.

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

## ◆ setConstructorTemplateId()

void UnqualifiedId::setConstructorTemplateId | ( | TemplateIdAnnotation * | TemplateId | ) |

Specify that this unqualified-id was parsed as a template-id that names a constructor.

Parameters

  TemplateId | the template-id annotation that describes the parsed template-id. This UnqualifiedId instance will take ownership of the `TemplateId` and will free it on destruction.

Definition at line 39 of file DeclSpec.cpp.

References EndLocation, clang::IK_ConstructorTemplateId, clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.

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

## ◆ setConversionFunctionId()

void clang::UnqualifiedId::setConversionFunctionId | ( | SourceLocation | OperatorLoc,
|  | ParsedType | Ty,
|  | SourceLocation | EndLoc
| ) |  |
| inline

Specify that this unqualified-id was parsed as a conversion-function-id.

Parameters

  OperatorLoc | the location of the 'operator' keyword.
  Ty | the type to which this conversion function is converting.
  EndLoc | the location of the last token that makes up the type name.

Definition at line 1050 of file DeclSpec.h.

References clang::IK_ConversionFunctionId.

## ◆ setDeductionGuideName()

void clang::UnqualifiedId::setDeductionGuideName | ( | ParsedTemplateTy | Template,
|  | SourceLocation | TemplateLoc
| ) |  |
| inline

Specify that this unqualified-id was parsed as a template-name for a deduction-guide.

Parameters

  Template | The parsed template-name.
  TemplateLoc | The location of the parsed template-name.

Definition at line 1126 of file DeclSpec.h.

References clang::IK_DeductionGuideName.

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

## ◆ setDestructorName()

void clang::UnqualifiedId::setDestructorName | ( | SourceLocation | TildeLoc,
|  | ParsedType | ClassType,
|  | SourceLocation | EndLoc
| ) |  |
| inline

Specify that this unqualified-id was parsed as a destructor name.

Parameters

  TildeLoc | the location of the '~' that introduces the destructor name.
  ClassType | the name of the class referred to by the destructor name.

Definition at line 1105 of file DeclSpec.h.

References clang::IK_DestructorName.

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

## ◆ setIdentifier()

void clang::UnqualifiedId::setIdentifier | ( | const IdentifierInfo * | Id,
|  | SourceLocation | IdLoc
| ) |  |
| inline

Specify that this unqualified-id was parsed as an identifier.

Parameters

  Id | the parsed identifier.
  IdLoc | the location of the parsed identifier.

Definition at line 1023 of file DeclSpec.h.

References Id, Identifier, and clang::IK_Identifier.

Referenced by addConstexprToLambdaDeclSpecifier(), HandleVectorSizeAttr(), clang::Parser::ParseUnqualifiedId(), clang::Declarator::SetIdentifier(), and clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec().

## ◆ setKind()

void clang::UnqualifiedId::setKind | ( | UnqualifiedIdKind | kind | ) |
| inline

Definition at line 1017 of file DeclSpec.h.

## ◆ setLiteralOperatorId()

void clang::UnqualifiedId::setLiteralOperatorId | ( | const IdentifierInfo * | Id,
|  | SourceLocation | OpLoc,
|  | SourceLocation | IdLoc
| ) |  |
| inline

Specific that this unqualified-id was parsed as a literal-operator-id.

Parameters

  Id | the parsed identifier.
  OpLoc | the location of the 'operator' keyword.
  IdLoc | the location of the identifier.

Definition at line 1067 of file DeclSpec.h.

References Id, Identifier, and clang::IK_LiteralOperatorId.

## ◆ setOperatorFunctionId()

void UnqualifiedId::setOperatorFunctionId | ( | SourceLocation | OperatorLoc,
|  | OverloadedOperatorKind | Op,
|  | SourceLocation | SymbolLocations[3]
| ) |  |

Specify that this unqualified-id was parsed as an operator-function-id.

Parameters

  OperatorLoc | the location of the 'operator' keyword.
  Op | the overloaded operator.
  SymbolLocations | the locations of the individual operator symbols in the operator.

Definition at line 1332 of file DeclSpec.cpp.

References EndLocation, clang::SourceLocation::getRawEncoding(), clang::IK_OperatorFunctionId, isValid(), clang::UnqualifiedId::OFI::Operator, OperatorFunctionId, StartLocation, and clang::UnqualifiedId::OFI::SymbolLocations.

Referenced by ParseReductionId().

## ◆ setTemplateId()

void UnqualifiedId::setTemplateId | ( | TemplateIdAnnotation * | TemplateId | ) |

Specify that this unqualified-id was parsed as a template-id.

Parameters

  TemplateId | the template-id annotation that describes the parsed template-id. This UnqualifiedId instance will take ownership of the `TemplateId` and will free it on destruction.

Definition at line 31 of file DeclSpec.cpp.

References EndLocation, clang::IK_TemplateId, clang::TemplateIdAnnotation::RAngleLoc, StartLocation, TemplateId, and clang::TemplateIdAnnotation::TemplateNameLoc.

Referenced by addConstexprToLambdaDeclSpecifier(), and clang::Parser::ParseUnqualifiedId().

## Member Data Documentation

## ◆ @214

union { ... }

Anonymous union that holds extra data associated with the parsed unqualified-id.

## ◆ ConstructorName

UnionParsedType clang::UnqualifiedId::ConstructorName

When Kind == IK_ConstructorName, the class-name of the type whose constructor is being referenced.

Definition at line 974 of file DeclSpec.h.

## ◆ ConversionFunctionId

UnionParsedType clang::UnqualifiedId::ConversionFunctionId

When Kind == IK_ConversionFunctionId, the type that the conversion function names.

Definition at line 970 of file DeclSpec.h.

Referenced by clang::Sema::CheckConversionDeclarator(), and GetDeclSpecTypeForDeclarator().

## ◆ DestructorName

UnionParsedType clang::UnqualifiedId::DestructorName

When Kind == IK_DestructorName, the type referred to by the class-name.

Definition at line 978 of file DeclSpec.h.

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

## ◆ EndLocation

SourceLocation clang::UnqualifiedId::EndLocation

The location of the last token that describes this unqualified-id.

Definition at line 995 of file DeclSpec.h.

Referenced by getMissingDeclaratorIdLoc(), setConstructorTemplateId(), setOperatorFunctionId(), and setTemplateId().

## ◆ Identifier

IdentifierInfo* clang::UnqualifiedId::Identifier

When Kind == IK_Identifier, the parsed identifier, or when Kind == IK_UserLiteralId, the identifier suffix.

Definition at line 962 of file DeclSpec.h.

Referenced by clang::Sema::ActOnPseudoDestructorExpr(), clang::Declarator::getIdentifier(), and clang::Declarator::hasName().

## ◆ Kind

UnqualifiedIdKind clang::UnqualifiedId::Kind

Describes the kind of unqualified-id parsed.

Definition at line 941 of file DeclSpec.h.

## ◆ OperatorFunctionId

struct OFI clang::UnqualifiedId::OperatorFunctionId

When Kind == IK_OperatorFunctionId, the overloaded operator that we parsed.

Definition at line 966 of file DeclSpec.h.

Referenced by clang::Declarator::isStaticMember(), and setOperatorFunctionId().

## ◆ StartLocation

SourceLocation clang::UnqualifiedId::StartLocation

The location of the first token that describes this unqualified-id, which will be the location of the identifier, "operator" keyword, tilde (for a destructor), or the template name of a template-id.

Definition at line 992 of file DeclSpec.h.

Referenced by clang::Sema::ActOnPseudoDestructorExpr(), clang::Declarator::getIdentifierLoc(), getMissingDeclaratorIdLoc(), setConstructorTemplateId(), setOperatorFunctionId(), and setTemplateId().

## ◆ TemplateId

TemplateIdAnnotation* clang::UnqualifiedId::TemplateId

When Kind == IK_TemplateId or IK_ConstructorTemplateId, the template-id annotation that contains the template name and template arguments.

Definition at line 986 of file DeclSpec.h.

Referenced by clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::DecomposeUnqualifiedId(), setConstructorTemplateId(), and setTemplateId().

## ◆ TemplateName

UnionParsedTemplateTy clang::UnqualifiedId::TemplateName

When Kind == IK_DeductionGuideName, the parsed template-name.

Definition at line 981 of file DeclSpec.h.

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

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

- include/clang/Sema/DeclSpec.h
- lib/Sema/DeclSpec.cpp