17#include "llvm/ADT/ArrayRef.h"
18#include "llvm/ADT/StringExtras.h"
26 if (Detail.is<
Expr *>())
29 auto &SubstitutionDiagnostic =
30 *Detail.get<std::pair<SourceLocation, StringRef> *>();
31 StringRef Message =
C.backupStr(SubstitutionDiagnostic.second);
32 auto *NewSubstDiag =
new (
C) std::pair<SourceLocation, StringRef>(
33 SubstitutionDiagnostic.first, Message);
40 : NumRecords{Satisfaction.Details.size()},
41 IsSatisfied{Satisfaction.IsSatisfied}, ContainsErrors{
42 Satisfaction.ContainsErrors} {
46 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
51 : NumRecords{Satisfaction.NumRecords},
52 IsSatisfied{Satisfaction.IsSatisfied},
53 ContainsErrors{Satisfaction.ContainsErrors} {
56 C, *(Satisfaction.
begin() + I),
57 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
64 totalSizeToAlloc<UnsatisfiedConstraintRecord>(
73 totalSizeToAlloc<UnsatisfiedConstraintRecord>(Satisfaction.
NumRecords);
81 ID.AddPointer(ConstraintOwner);
82 ID.AddInteger(TemplateArgs.size());
83 for (
auto &Arg : TemplateArgs)
94 FoundDecl, NamedConcept, ArgsAsWritten);
104 llvm::ListSeparator Sep(
", ");
106 for (
auto &ArgLoc : ArgsAsWritten->
arguments()) {
108 ArgLoc.getArgument().print(Policy, OS,
false);
static void CreateUnsatisfiedConstraintRecord(const ASTContext &C, const UnsatisfiedConstraintRecord &Detail, UnsatisfiedConstraintRecord *TrailingObject)
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Declaration of a C++20 concept.
A reference to a concept and its template args, as it appears in the code.
bool hasExplicitTemplateArgs() const
Whether or not template arguments were explicitly specified in the concept reference (they might not ...
static ConceptReference * Create(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)
void print(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C)
llvm::SmallVector< Detail, 4 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
This represents one expression.
This represents a decl that may have a name.
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false) const
Print this nested name specifier to the given output stream.
Encodes a location in the source.
The JSON file list parser is used to communicate input to InstallAPI.
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...
static ASTConstraintSatisfaction * Rebuild(const ASTContext &C, const ASTConstraintSatisfaction &Satisfaction)
ASTConstraintSatisfaction(const ASTContext &C, const ConstraintSatisfaction &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>".
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
void printName(raw_ostream &OS, PrintingPolicy Policy) const
printName - Print the human-readable name to a stream.
Describes how types, statements, expressions, and declarations should be printed.