clang 22.0.0git
clang::ConceptReference Class Reference

A reference to a concept and its template args, as it appears in the code. More...

#include "clang/AST/ASTConcept.h"

Public Member Functions

const NestedNameSpecifierLocgetNestedNameSpecifierLoc () const
const DeclarationNameInfogetConceptNameInfo () const
SourceLocation getConceptNameLoc () const
SourceLocation getTemplateKWLoc () const
SourceLocation getLocation () const
SourceLocation getBeginLoc () const LLVM_READONLY
SourceLocation getEndLoc () const LLVM_READONLY
SourceRange getSourceRange () const LLVM_READONLY
NamedDeclgetFoundDecl () const
TemplateDeclgetNamedConcept () const
const ASTTemplateArgumentListInfogetTemplateArgsAsWritten () const
bool hasExplicitTemplateArgs () const
 Whether or not template arguments were explicitly specified in the concept reference (they might not be in type constraints, for example)
void print (llvm::raw_ostream &OS, const PrintingPolicy &Policy) const
void dump () const
void dump (llvm::raw_ostream &) const

Static Public Member Functions

static ConceptReferenceCreate (const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, TemplateDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)

Protected Member Functions

 ConceptReference (NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, TemplateDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)

Protected Attributes

NestedNameSpecifierLoc NestedNameSpec
SourceLocation TemplateKWLoc
 The location of the template keyword, if specified when naming the concept.
DeclarationNameInfo ConceptName
 The concept name used.
NamedDeclFoundDecl
 The declaration found by name lookup when the expression was created.
TemplateDeclNamedConcept
 The concept named.
const ASTTemplateArgumentListInfoArgsAsWritten
 The template argument list source info used to specialize the concept.

Detailed Description

A reference to a concept and its template args, as it appears in the code.

Examples: template <int X> requires is_even<X> int half = X/2; ~~~~~~~~~~ (in ConceptSpecializationExpr)

std::input_iterator auto I = Container.begin(); ~~~~~~~~~~~~~~~~~~~ (in AutoTypeLoc)

template <std::derives_from<Expr> T> void dump(); ~~~~~~~~~~~~~~~~~~~~~~~ (in TemplateTypeParmDecl)

Definition at line 126 of file ASTConcept.h.

Constructor & Destructor Documentation

◆ ConceptReference()

clang::ConceptReference::ConceptReference ( NestedNameSpecifierLoc NNS,
SourceLocation TemplateKWLoc,
DeclarationNameInfo ConceptNameInfo,
NamedDecl * FoundDecl,
TemplateDecl * NamedConcept,
const ASTTemplateArgumentListInfo * ArgsAsWritten )
inlineprotected

Definition at line 151 of file ASTConcept.h.

References ArgsAsWritten, ConceptName, FoundDecl, NamedConcept, NestedNameSpec, and TemplateKWLoc.

Referenced by Create().

Member Function Documentation

◆ Create()

◆ dump() [1/2]

LLVM_DUMP_METHOD void ConceptReference::dump ( ) const

Definition at line 354 of file ASTDumper.cpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

void clang::ConceptReference::dump ( llvm::raw_ostream & ) const

◆ getBeginLoc()

SourceLocation ConceptReference::getBeginLoc ( ) const

◆ getConceptNameInfo()

const DeclarationNameInfo & clang::ConceptReference::getConceptNameInfo ( ) const
inline

◆ getConceptNameLoc()

SourceLocation clang::ConceptReference::getConceptNameLoc ( ) const
inline

Definition at line 172 of file ASTConcept.h.

References getConceptNameInfo(), and clang::DeclarationNameInfo::getLoc().

Referenced by getLocation().

◆ getEndLoc()

◆ getFoundDecl()

NamedDecl * clang::ConceptReference::getFoundDecl ( ) const
inline

◆ getLocation()

SourceLocation clang::ConceptReference::getLocation ( ) const
inline

Definition at line 178 of file ASTConcept.h.

References getConceptNameLoc().

Referenced by clang::JSONNodeDumper::Visit().

◆ getNamedConcept()

TemplateDecl * clang::ConceptReference::getNamedConcept ( ) const
inline

◆ getNestedNameSpecifierLoc()

const NestedNameSpecifierLoc & clang::ConceptReference::getNestedNameSpecifierLoc ( ) const
inline

◆ getSourceRange()

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

Definition at line 189 of file ASTConcept.h.

References getBeginLoc(), and getEndLoc().

Referenced by clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::Visit().

◆ getTemplateArgsAsWritten()

const ASTTemplateArgumentListInfo * clang::ConceptReference::getTemplateArgsAsWritten ( ) const
inline

◆ getTemplateKWLoc()

SourceLocation clang::ConceptReference::getTemplateKWLoc ( ) const
inline

◆ hasExplicitTemplateArgs()

bool clang::ConceptReference::hasExplicitTemplateArgs ( ) const
inline

Whether or not template arguments were explicitly specified in the concept reference (they might not be in type constraints, for example)

Definition at line 205 of file ASTConcept.h.

References ArgsAsWritten.

Referenced by clang::ASTContext::isSameTypeConstraint(), and print().

◆ print()

void ConceptReference::print ( llvm::raw_ostream & OS,
const PrintingPolicy & Policy ) const

Definition at line 103 of file ASTConcept.cpp.

References ArgsAsWritten, ConceptName, hasExplicitTemplateArgs(), and NestedNameSpec.

Member Data Documentation

◆ ArgsAsWritten

const ASTTemplateArgumentListInfo* clang::ConceptReference::ArgsAsWritten
protected

The template argument list source info used to specialize the concept.

Definition at line 149 of file ASTConcept.h.

Referenced by ConceptReference(), Create(), getTemplateArgsAsWritten(), hasExplicitTemplateArgs(), and print().

◆ ConceptName

DeclarationNameInfo clang::ConceptReference::ConceptName
protected

The concept name used.

Definition at line 136 of file ASTConcept.h.

Referenced by ConceptReference(), getConceptNameInfo(), and print().

◆ FoundDecl

NamedDecl* clang::ConceptReference::FoundDecl
protected

The declaration found by name lookup when the expression was created.

Can differ from NamedConcept when, for example, the concept was found through a UsingShadowDecl.

Definition at line 142 of file ASTConcept.h.

Referenced by ConceptReference(), Create(), and getFoundDecl().

◆ NamedConcept

TemplateDecl* clang::ConceptReference::NamedConcept
protected

The concept named.

Definition at line 145 of file ASTConcept.h.

Referenced by ConceptReference(), Create(), and getNamedConcept().

◆ NestedNameSpec

NestedNameSpecifierLoc clang::ConceptReference::NestedNameSpec
protected

Definition at line 129 of file ASTConcept.h.

Referenced by ConceptReference(), getNestedNameSpecifierLoc(), and print().

◆ TemplateKWLoc

SourceLocation clang::ConceptReference::TemplateKWLoc
protected

The location of the template keyword, if specified when naming the concept.

Definition at line 133 of file ASTConcept.h.

Referenced by ConceptReference(), Create(), and getTemplateKWLoc().


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