clang 22.0.0git
clang::NestedNameSpecifierLoc Class Reference

A C++ nested-name-specifier augmented with source location information. More...

#include "clang/AST/NestedNameSpecifierBase.h"

Public Member Functions

 NestedNameSpecifierLoc ()=default
 Construct an empty nested-name-specifier.
 NestedNameSpecifierLoc (NestedNameSpecifier Qualifier, void *Data)
 Construct a nested-name-specifier with source location information from.
 operator bool () const
 Evaluates true when this nested-name-specifier location is non-empty.
bool hasQualifier () const
 Evaluates true when this nested-name-specifier location is non-empty.
NestedNameSpecifier getNestedNameSpecifier () const
 Retrieve the nested-name-specifier to which this instance refers.
void * getOpaqueData () const
 Retrieve the opaque pointer that refers to source-location data.
SourceRange getSourceRange () const LLVM_READONLY
 Retrieve the source range covering the entirety of this nested-name-specifier.
SourceRange getLocalSourceRange () const
 Retrieve the source range covering just the last part of this nested-name-specifier, not including the prefix.
SourceLocation getBeginLoc () const
 Retrieve the location of the beginning of this nested-name-specifier.
SourceLocation getEndLoc () const
 Retrieve the location of the end of this nested-name-specifier.
SourceLocation getLocalBeginLoc () const
 Retrieve the location of the beginning of this component of the nested-name-specifier.
SourceLocation getLocalEndLoc () const
 Retrieve the location of the end of this component of the nested-name-specifier.
NamespaceAndPrefixLoc castAsNamespaceAndPrefix () const
 For a nested-name-specifier that refers to a namespace, retrieve the namespace and its prefix.
NamespaceAndPrefixLoc getAsNamespaceAndPrefix () const
TypeLoc castAsTypeLoc () const
 For a nested-name-specifier that refers to a type, retrieve the type with source-location information.
TypeLoc getAsTypeLoc () const
unsigned getDataLength () const
 Determines the data length for the entire nested-name-specifier.

Friends

bool operator== (NestedNameSpecifierLoc X, NestedNameSpecifierLoc Y)
bool operator!= (NestedNameSpecifierLoc X, NestedNameSpecifierLoc Y)

Detailed Description

A C++ nested-name-specifier augmented with source location information.

Definition at line 301 of file NestedNameSpecifierBase.h.

Constructor & Destructor Documentation

◆ NestedNameSpecifierLoc() [1/2]

clang::NestedNameSpecifierLoc::NestedNameSpecifierLoc ( )
default

Construct an empty nested-name-specifier.

Referenced by castAsNamespaceAndPrefix(), getBeginLoc(), operator!=, and operator==.

◆ NestedNameSpecifierLoc() [2/2]

clang::NestedNameSpecifierLoc::NestedNameSpecifierLoc ( NestedNameSpecifier Qualifier,
void * Data )
inline

Construct a nested-name-specifier with source location information from.

Definition at line 335 of file NestedNameSpecifierBase.h.

Member Function Documentation

◆ castAsNamespaceAndPrefix()

NamespaceAndPrefixLoc clang::NestedNameSpecifierLoc::castAsNamespaceAndPrefix ( ) const
inline

For a nested-name-specifier that refers to a namespace, retrieve the namespace and its prefix.

For example, if this instance refers to a nested-name-specifier ::std::chrono::, the prefix is ::std::. Note that the returned prefix may be empty, if this is the first component of the nested-name-specifier.

Definition at line 174 of file NestedNameSpecifier.h.

References NestedNameSpecifierLoc().

Referenced by getAsNamespaceAndPrefix(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), and clang::RecursiveASTVisitor< Derived >::TraverseNestedNameSpecifierLoc().

◆ castAsTypeLoc()

◆ getAsNamespaceAndPrefix()

◆ getAsTypeLoc()

TypeLoc clang::NestedNameSpecifierLoc::getAsTypeLoc ( ) const
inline

◆ getBeginLoc()

◆ getDataLength()

unsigned clang::NestedNameSpecifierLoc::getDataLength ( ) const
inline

Determines the data length for the entire nested-name-specifier.

Definition at line 195 of file NestedNameSpecifier.h.

References getDataLength().

Referenced by getDataLength(), and getLocalSourceRange().

◆ getEndLoc()

SourceLocation clang::NestedNameSpecifierLoc::getEndLoc ( ) const
inline

Retrieve the location of the end of this nested-name-specifier.

Definition at line 231 of file NestedNameSpecifier.h.

References clang::SourceRange::getEnd(), and getLocalSourceRange().

Referenced by getSourceRange(), and clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc().

◆ getLocalBeginLoc()

SourceLocation clang::NestedNameSpecifierLoc::getLocalBeginLoc ( ) const
inline

◆ getLocalEndLoc()

SourceLocation clang::NestedNameSpecifierLoc::getLocalEndLoc ( ) const
inline

◆ getLocalSourceRange()

SourceRange clang::NestedNameSpecifierLoc::getLocalSourceRange ( ) const
inline

Retrieve the source range covering just the last part of this nested-name-specifier, not including the prefix.

For example, if this instance refers to a nested-name-specifier ::std::vector<int>::, the returned source range would cover from "vector" to the last '::'.

Definition at line 199 of file NestedNameSpecifier.h.

References clang::TypeLoc::getBeginLoc(), getDataLength(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::MicrosoftSuper, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::Null, and clang::NestedNameSpecifier::Type.

Referenced by clang::ASTRecordWriter::AddNestedNameSpecifierLoc(), getEndLoc(), getLocalBeginLoc(), and getLocalEndLoc().

◆ getNestedNameSpecifier()

◆ getOpaqueData()

◆ getSourceRange()

SourceRange clang::NestedNameSpecifierLoc::getSourceRange ( ) const
inline

Retrieve the source range covering the entirety of this nested-name-specifier.

For example, if this instance refers to a nested-name-specifier ::std::vector<int>::, the returned source range would cover from the initial '::' to the last '::'.

Definition at line 227 of file NestedNameSpecifier.h.

References getBeginLoc(), and getEndLoc().

Referenced by clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckFriendAccess(), clang::NestedNameSpecifierLocBuilder::getSourceRange(), clang::ASTImporter::Import(), clang::TreeTransform< AdjustConstraintDepth >::RebuildDependentNameType(), clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(), clang::TreeTransform< Derived >::TransformOverloadExprDecls(), and TraverseNestedNameSpecifierLoc().

◆ hasQualifier()

bool clang::NestedNameSpecifierLoc::hasQualifier ( ) const
inline

Evaluates true when this nested-name-specifier location is non-empty.

Definition at line 344 of file NestedNameSpecifierBase.h.

References bool.

Referenced by clang::MemberExpr::Create(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

◆ operator bool()

clang::NestedNameSpecifierLoc::operator bool ( ) const
inlineexplicit

Evaluates true when this nested-name-specifier location is non-empty.

Definition at line 340 of file NestedNameSpecifierBase.h.

References bool.

◆ operator!=

bool operator!= ( NestedNameSpecifierLoc X,
NestedNameSpecifierLoc Y )
friend

Definition at line 408 of file NestedNameSpecifierBase.h.

References NestedNameSpecifierLoc(), and X.

◆ operator==

bool operator== ( NestedNameSpecifierLoc X,
NestedNameSpecifierLoc Y )
friend

Definition at line 404 of file NestedNameSpecifierBase.h.

References NestedNameSpecifierLoc(), and X.


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