17#include "llvm/ADT/StringExtras.h"
25 if (
auto *
E = dyn_cast<Expr *>(Detail))
28 auto &SubstitutionDiagnostic =
29 *cast<std::pair<SourceLocation, StringRef> *>(Detail);
30 StringRef Message =
C.backupStr(SubstitutionDiagnostic.second);
31 auto *NewSubstDiag =
new (
C) std::pair<SourceLocation, StringRef>(
32 SubstitutionDiagnostic.first, Message);
39 : NumRecords{Satisfaction.Details.size()},
40 IsSatisfied{Satisfaction.IsSatisfied}, ContainsErrors{
41 Satisfaction.ContainsErrors} {
45 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
50 : NumRecords{Satisfaction.NumRecords},
51 IsSatisfied{Satisfaction.IsSatisfied},
52 ContainsErrors{Satisfaction.ContainsErrors} {
55 C, *(Satisfaction.
begin() + I),
56 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
63 totalSizeToAlloc<UnsatisfiedConstraintRecord>(
72 totalSizeToAlloc<UnsatisfiedConstraintRecord>(Satisfaction.
NumRecords);
80 ID.AddPointer(ConstraintOwner);
81 ID.AddInteger(TemplateArgs.size());
82 for (
auto &Arg : TemplateArgs)
93 FoundDecl, NamedConcept, ArgsAsWritten);
103 llvm::ListSeparator Sep(
", ");
105 for (
auto &ArgLoc : ArgsAsWritten->
arguments()) {
107 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 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.