Go to the documentation of this file.
14 #ifndef LLVM_CLANG_AST_ASTCONCEPT_H
15 #define LLVM_CLANG_AST_ASTCONCEPT_H
19 #include "llvm/ADT/PointerUnion.h"
20 #include "llvm/ADT/SmallVector.h"
31 const NamedDecl *ConstraintOwner =
nullptr;
40 ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs.begin(),
41 TemplateArgs.end()) { }
44 using Detail = llvm::PointerUnion<Expr *, SubstitutionDiagnostic *>;
55 Profile(
ID, C, ConstraintOwner, TemplateArgs);
68 std::pair<
const Expr *,
69 llvm::PointerUnion<Expr *,
70 std::pair<SourceLocation, StringRef> *>>;
77 llvm::TrailingObjects<ASTConstraintSatisfaction,
78 UnsatisfiedConstraintRecord> {
83 return getTrailingObjects<UnsatisfiedConstraintRecord>();
87 return getTrailingObjects<UnsatisfiedConstraintRecord>() +
NumRecords;
170 Expr *ImmediatelyDeclaredConstraint =
nullptr;
177 Expr *ImmediatelyDeclaredConstraint) :
180 ImmediatelyDeclaredConstraint(ImmediatelyDeclaredConstraint) {}
186 return ImmediatelyDeclaredConstraint;
194 #endif // LLVM_CLANG_AST_ASTCONCEPT_H
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Encodes a location in the source.
This represents a decl that may have a name.
ConceptDecl * getNamedConcept() const
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
Describes how types, statements, expressions, and declarations should be printed.
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
std::pair< const Expr *, llvm::PointerUnion< Expr *, std::pair< SourceLocation, StringRef > * > > UnsatisfiedConstraintRecord
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Declaration of a C++2a concept.
ConstraintSatisfaction()=default
DeclarationNameInfo ConceptName
The concept name used.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ConceptDecl * NamedConcept
The concept named.
SourceLocation getTemplateKWLoc() const
bool hasExplicitTemplateArgs() const
Whether or not template arguments were explicitly specified in the concept reference (they might not ...
NamedDecl * getFoundDecl() const
void print(llvm::raw_ostream &OS, PrintingPolicy Policy) const
A C++ nested-name-specifier augmented with source location information.
const UnsatisfiedConstraintRecord * begin() const
const UnsatisfiedConstraintRecord * end() const
const ASTTemplateArgumentListInfo * ArgsAsWritten
The template argument list source info used to specialize the concept.
NestedNameSpecifierLoc NestedNameSpec
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C)
Common data class for constructs that reference concepts with template arguments.
ConceptReference(NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)
SourceLocation getConceptNameLoc() const
TypeConstraint(NestedNameSpecifierLoc NNS, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, Expr *ImmediatelyDeclaredConstraint)
llvm::PointerUnion< Expr *, SubstitutionDiagnostic * > Detail
ASTConstraintSatisfaction(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
ConstraintSatisfaction(const NamedDecl *ConstraintOwner, ArrayRef< TemplateArgument > TemplateArgs)
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
const DeclarationNameInfo & getConceptNameInfo() const
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
NamedDecl * FoundDecl
The declaration found by name lookup when the expression was created.
This represents one expression.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
SourceLocation TemplateKWLoc
The location of the template keyword, if specified when naming the concept.
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)