class CXXScopeSpec

Declaration

class CXXScopeSpec { /* full declaration omitted */ };

Description

Represents a C++ nested-name-specifier or a global scope specifier. These can be in 3 states: 1) Not present, identified by isEmpty() 2) Present, identified by isNotEmpty() 2.a) Valid, identified by isValid() 2.b) Invalid, identified by isInvalid(). isSet() is deprecated because it mostly corresponded to "valid" but was often used as if it meant "present". The actual scope is described by getScopeRep().

Declared at: clang/include/clang/Sema/DeclSpec.h:64

Member Variables

private clang::SourceRange Range
private clang::NestedNameSpecifierLocBuilder Builder

Method Overview

  • public void Adopt(clang::NestedNameSpecifierLoc Other)
  • public void Extend(clang::ASTContext & Context, clang::SourceLocation TemplateKWLoc, clang::TypeLoc TL, clang::SourceLocation ColonColonLoc)
  • public void Extend(clang::ASTContext & Context, clang::IdentifierInfo * Identifier, clang::SourceLocation IdentifierLoc, clang::SourceLocation ColonColonLoc)
  • public void Extend(clang::ASTContext & Context, clang::NamespaceDecl * Namespace, clang::SourceLocation NamespaceLoc, clang::SourceLocation ColonColonLoc)
  • public void Extend(clang::ASTContext & Context, clang::NamespaceAliasDecl * Alias, clang::SourceLocation AliasLoc, clang::SourceLocation ColonColonLoc)
  • public void MakeGlobal(clang::ASTContext & Context, clang::SourceLocation ColonColonLoc)
  • public void MakeSuper(clang::ASTContext & Context, clang::CXXRecordDecl * RD, clang::SourceLocation SuperLoc, clang::SourceLocation ColonColonLoc)
  • public void MakeTrivial(clang::ASTContext & Context, clang::NestedNameSpecifier * Qualifier, clang::SourceRange R)
  • public void SetInvalid(clang::SourceRange R)
  • public void clear()
  • public clang::SourceLocation getBeginLoc() const
  • public clang::SourceLocation getEndLoc() const
  • public clang::SourceLocation getLastQualifierNameLoc() const
  • public clang::SourceRange getRange() const
  • public clang::NestedNameSpecifier * getScopeRep() const
  • public clang::NestedNameSpecifierLoc getWithLocInContext(clang::ASTContext & Context) const
  • public bool isEmpty() const
  • public bool isInvalid() const
  • public bool isNotEmpty() const
  • public bool isSet() const
  • public bool isValid() const
  • public char * location_data() const
  • public unsigned int location_size() const
  • public void setBeginLoc(clang::SourceLocation Loc)
  • public void setEndLoc(clang::SourceLocation Loc)
  • public void setRange(clang::SourceRange R)

Methods

void Adopt(clang::NestedNameSpecifierLoc Other)

Description

Adopt an existing nested-name-specifier (with source-range information).

Declared at: clang/include/clang/Sema/DeclSpec.h:169

Parameters

clang::NestedNameSpecifierLoc Other

void Extend(clang::ASTContext& Context,
            clang::SourceLocation TemplateKWLoc,
            clang::TypeLoc TL,
            clang::SourceLocation ColonColonLoc)

Description

Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type::'.

Declared at: clang/include/clang/Sema/DeclSpec.h:92

Parameters

clang::ASTContext& Context
The AST context in which this nested-name-specifier resides.
clang::SourceLocation TemplateKWLoc
The location of the 'template' keyword, if present.
clang::TypeLoc TL
The TypeLoc that describes the type preceding the '::'.
clang::SourceLocation ColonColonLoc
The location of the trailing '::'.

void Extend(clang::ASTContext& Context,
            clang::IdentifierInfo* Identifier,
            clang::SourceLocation IdentifierLoc,
            clang::SourceLocation ColonColonLoc)

Description

Extend the current nested-name-specifier by another nested-name-specifier component of the form 'identifier::'.

Declared at: clang/include/clang/Sema/DeclSpec.h:106

Parameters

clang::ASTContext& Context
The AST context in which this nested-name-specifier resides.
clang::IdentifierInfo* Identifier
The identifier.
clang::SourceLocation IdentifierLoc
The location of the identifier.
clang::SourceLocation ColonColonLoc
The location of the trailing '::'.

void Extend(clang::ASTContext& Context,
            clang::NamespaceDecl* Namespace,
            clang::SourceLocation NamespaceLoc,
            clang::SourceLocation ColonColonLoc)

Description

Extend the current nested-name-specifier by another nested-name-specifier component of the form 'namespace::'.

Declared at: clang/include/clang/Sema/DeclSpec.h:120

Parameters

clang::ASTContext& Context
The AST context in which this nested-name-specifier resides.
clang::NamespaceDecl* Namespace
The namespace.
clang::SourceLocation NamespaceLoc
The location of the namespace name.
clang::SourceLocation ColonColonLoc
The location of the trailing '::'.

void Extend(clang::ASTContext& Context,
            clang::NamespaceAliasDecl* Alias,
            clang::SourceLocation AliasLoc,
            clang::SourceLocation ColonColonLoc)

Description

Extend the current nested-name-specifier by another nested-name-specifier component of the form 'namespace-alias::'.

Declared at: clang/include/clang/Sema/DeclSpec.h:135

Parameters

clang::ASTContext& Context
The AST context in which this nested-name-specifier resides.
clang::NamespaceAliasDecl* Alias
The namespace alias.
clang::SourceLocation AliasLoc
The location of the namespace alias name.
clang::SourceLocation ColonColonLoc
The location of the trailing '::'.

void MakeGlobal(
    clang::ASTContext& Context,
    clang::SourceLocation ColonColonLoc)

Description

Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.

Declared at: clang/include/clang/Sema/DeclSpec.h:140

Parameters

clang::ASTContext& Context
clang::SourceLocation ColonColonLoc

void MakeSuper(
    clang::ASTContext& Context,
    clang::CXXRecordDecl* RD,
    clang::SourceLocation SuperLoc,
    clang::SourceLocation ColonColonLoc)

Description

Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.

Declared at: clang/include/clang/Sema/DeclSpec.h:155

Parameters

clang::ASTContext& Context
The AST context in which this nested-name-specifier resides.
clang::CXXRecordDecl* RD
The declaration of the class in which nested-name-specifier appeared.
clang::SourceLocation SuperLoc
The location of the '__super' keyword. name.
clang::SourceLocation ColonColonLoc
The location of the trailing '::'.

void MakeTrivial(
    clang::ASTContext& Context,
    clang::NestedNameSpecifier* Qualifier,
    clang::SourceRange R)

Description

Make a new nested-name-specifier from incomplete source-location information. FIXME: This routine should be used very, very rarely, in cases where we need to synthesize a nested-name-specifier. Most code should instead use\c Adopt() with a proper \c NestedNameSpecifierLoc.

Declared at: clang/include/clang/Sema/DeclSpec.h:164

Parameters

clang::ASTContext& Context
clang::NestedNameSpecifier* Qualifier
clang::SourceRange R

void SetInvalid(clang::SourceRange R)

Description

Indicate that this nested-name-specifier is invalid.

Declared at: clang/include/clang/Sema/DeclSpec.h:200

Parameters

clang::SourceRange R

void clear()

Declared at: clang/include/clang/Sema/DeclSpec.h:212

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/Sema/DeclSpec.h:73

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/Sema/DeclSpec.h:74

clang::SourceLocation getLastQualifierNameLoc()
    const

Description

Retrieve the location of the name in the last qualifier in this nested name specifier. For example, the location of \c bar in

Declared at: clang/include/clang/Sema/DeclSpec.h:187

clang::SourceRange getRange() const

Declared at: clang/include/clang/Sema/DeclSpec.h:69

clang::NestedNameSpecifier* getScopeRep() const

Description

Retrieve the representation of the nested-name-specifier.

Declared at: clang/include/clang/Sema/DeclSpec.h:77

clang::NestedNameSpecifierLoc getWithLocInContext(
    clang::ASTContext& Context) const

Description

Retrieve a nested-name-specifier with location information, copied into the given AST context.

Declared at: clang/include/clang/Sema/DeclSpec.h:176

Parameters

clang::ASTContext& Context
The context into which this nested-name-specifier will be copied.

bool isEmpty() const

Description

No scope specifier.

Declared at: clang/include/clang/Sema/DeclSpec.h:190

bool isInvalid() const

Description

An error occurred during parsing of the scope specifier.

Declared at: clang/include/clang/Sema/DeclSpec.h:195

bool isNotEmpty() const

Description

A scope specifier is present, but may be valid or invalid.

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

bool isSet() const

Description

Deprecated. Some call sites intend isNotEmpty() while others intend isValid().

Declared at: clang/include/clang/Sema/DeclSpec.h:210

bool isValid() const

Description

A scope specifier is present, and it refers to a real scope.

Declared at: clang/include/clang/Sema/DeclSpec.h:197

char* location_data() const

Description

Retrieve the data associated with the source-location information.

Declared at: clang/include/clang/Sema/DeclSpec.h:218

unsigned int location_size() const

Description

Retrieve the size of the data associated with source-location information.

Declared at: clang/include/clang/Sema/DeclSpec.h:222

void setBeginLoc(clang::SourceLocation Loc)

Declared at: clang/include/clang/Sema/DeclSpec.h:71

Parameters

clang::SourceLocation Loc

void setEndLoc(clang::SourceLocation Loc)

Declared at: clang/include/clang/Sema/DeclSpec.h:72

Parameters

clang::SourceLocation Loc

void setRange(clang::SourceRange R)

Declared at: clang/include/clang/Sema/DeclSpec.h:70

Parameters

clang::SourceRange R