clang 20.0.0git
|
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string> T> void print(T object); ~~~~~~~~~~~~~~~~~~~~~~ Semantically, this adds an "immediately-declared constraint" with extra arg: requires convertible_to<T, string> More...
#include "clang/AST/ASTConcept.h"
Public Member Functions | |
TypeConstraint (ConceptReference *ConceptRef, Expr *ImmediatelyDeclaredConstraint) | |
Expr * | getImmediatelyDeclaredConstraint () const |
Get the immediately-declared constraint expression introduced by this type-constraint, that is - the constraint expression that is added to the associated constraints of the enclosing declaration in practice. | |
ConceptReference * | getConceptReference () const |
ConceptDecl * | getNamedConcept () const |
SourceLocation | getConceptNameLoc () const |
bool | hasExplicitTemplateArgs () const |
const ASTTemplateArgumentListInfo * | getTemplateArgsAsWritten () const |
SourceLocation | getTemplateKWLoc () const |
NamedDecl * | getFoundDecl () const |
const NestedNameSpecifierLoc & | getNestedNameSpecifierLoc () const |
const DeclarationNameInfo & | getConceptNameInfo () const |
void | print (llvm::raw_ostream &OS, const PrintingPolicy &Policy) const |
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string> T> void print(T object); ~~~~~~~~~~~~~~~~~~~~~~ Semantically, this adds an "immediately-declared constraint" with extra arg: requires convertible_to<T, string>
In the C++ grammar, a type-constraint is also used for auto types: convertible_to<string> auto X = ...; We do not model these as TypeConstraints, but AutoType(Loc) directly.
Definition at line 227 of file ASTConcept.h.
|
inline |
Definition at line 234 of file ASTConcept.h.
|
inline |
Definition at line 274 of file ASTConcept.h.
References clang::ConceptReference::getConceptNameInfo().
Referenced by clang::Sema::SubstTypeConstraint().
|
inline |
Definition at line 252 of file ASTConcept.h.
References clang::ConceptReference::getConceptNameLoc().
|
inline |
Definition at line 246 of file ASTConcept.h.
Referenced by clang::ASTContext::isSameTypeConstraint(), clang::Sema::SubstTypeConstraint(), and clang::ASTDeclWriter::VisitTemplateTypeParmDecl().
|
inline |
Definition at line 268 of file ASTConcept.h.
References clang::ConceptReference::getFoundDecl().
|
inline |
Get the immediately-declared constraint expression introduced by this type-constraint, that is - the constraint expression that is added to the associated constraints of the enclosing declaration in practice.
Definition at line 242 of file ASTConcept.h.
Referenced by clang::Sema::BuildExprRequirement(), clang::ASTContext::isSameTypeConstraint(), clang::concepts::ExprRequirement::ReturnTypeRequirement::ReturnTypeRequirement(), clang::Sema::SubstTypeConstraint(), and clang::ASTDeclWriter::VisitTemplateTypeParmDecl().
|
inline |
Definition at line 250 of file ASTConcept.h.
References clang::ConceptReference::getNamedConcept().
Referenced by clang::ASTContext::isSameTypeConstraint(), and clang::Sema::SubstTypeConstraint().
|
inline |
Definition at line 270 of file ASTConcept.h.
References clang::ConceptReference::getNestedNameSpecifierLoc().
Referenced by clang::Sema::SubstTypeConstraint().
|
inline |
Definition at line 260 of file ASTConcept.h.
References clang::ConceptReference::getTemplateArgsAsWritten().
Referenced by clang::Sema::SubstTypeConstraint().
|
inline |
Definition at line 264 of file ASTConcept.h.
References clang::ConceptReference::getTemplateKWLoc().
|
inline |
Definition at line 256 of file ASTConcept.h.
References clang::ConceptReference::hasExplicitTemplateArgs().
|
inline |
Definition at line 278 of file ASTConcept.h.
References clang::ConceptReference::print().