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 *>;
56 Profile(ID,
C, ConstraintOwner, TemplateArgs);
76 std::pair<
const Expr *,
77 llvm::PointerUnion<
Expr *,
78 std::pair<SourceLocation, StringRef> *>>;
85 llvm::TrailingObjects<ASTConstraintSatisfaction,
86 UnsatisfiedConstraintRecord> {
92 return getTrailingObjects<UnsatisfiedConstraintRecord>();
96 return getTrailingObjects<UnsatisfiedConstraintRecord>() +
NumRecords;
183 Expr *ImmediatelyDeclaredConstraint =
nullptr;
190 Expr *ImmediatelyDeclaredConstraint) :
193 ImmediatelyDeclaredConstraint(ImmediatelyDeclaredConstraint) {}
199 return ImmediatelyDeclaredConstraint;
Defines the clang::SourceLocation class and associated facilities.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Declaration of a C++20 concept.
Common data class for constructs that reference concepts with template arguments.
NestedNameSpecifierLoc NestedNameSpec
bool hasExplicitTemplateArgs() const
Whether or not template arguments were explicitly specified in the concept reference (they might not ...
DeclarationNameInfo ConceptName
The concept name used.
ConceptReference(NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)
ConceptDecl * NamedConcept
The concept named.
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
NamedDecl * getFoundDecl() const
const DeclarationNameInfo & getConceptNameInfo() const
SourceLocation getConceptNameLoc() const
ConceptDecl * getNamedConcept() const
SourceLocation TemplateKWLoc
The location of the template keyword, if specified when naming the concept.
const ASTTemplateArgumentListInfo * ArgsAsWritten
The template argument list source info used to specialize the concept.
NamedDecl * FoundDecl
The declaration found by name lookup when the expression was created.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
SourceLocation getTemplateKWLoc() const
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
llvm::PointerUnion< Expr *, SubstitutionDiagnostic * > Detail
ConstraintSatisfaction(const NamedDecl *ConstraintOwner, ArrayRef< TemplateArgument > TemplateArgs)
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C)
ConstraintSatisfaction()=default
bool HasSubstitutionFailure()
This represents one expression.
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
Encodes a location in the source.
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
void print(llvm::raw_ostream &OS, PrintingPolicy Policy) const
TypeConstraint(NestedNameSpecifierLoc NNS, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, Expr *ImmediatelyDeclaredConstraint)
@ C
Languages that the frontend can parse and compile.
std::pair< const Expr *, llvm::PointerUnion< Expr *, std::pair< SourceLocation, StringRef > * > > UnsatisfiedConstraintRecord
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
const UnsatisfiedConstraintRecord * end() const
static ASTConstraintSatisfaction * Rebuild(const ASTContext &C, const ASTConstraintSatisfaction &Satisfaction)
const UnsatisfiedConstraintRecord * begin() const
static ASTConstraintSatisfaction * Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction)
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
Describes how types, statements, expressions, and declarations should be printed.