17#include "llvm/ADT/ArrayRef.h"
22void CreatUnsatisfiedConstraintRecord(
25 if (Detail.second.is<
Expr *>())
28 UnsatisfiedConstraintRecord::second_type(Detail.second.get<
Expr *>())};
30 auto &SubstitutionDiagnostic =
31 *Detail.second.get<std::pair<SourceLocation, StringRef> *>();
32 unsigned MessageSize = SubstitutionDiagnostic.second.size();
33 char *Mem =
new (
C)
char[MessageSize];
34 memcpy(Mem, SubstitutionDiagnostic.second.data(), MessageSize);
35 auto *NewSubstDiag =
new (
C) std::pair<SourceLocation, StringRef>(
36 SubstitutionDiagnostic.first, StringRef(Mem, MessageSize));
38 Detail.first, UnsatisfiedConstraintRecord::second_type(NewSubstDiag)};
45 : NumRecords{Satisfaction.Details.size()},
46 IsSatisfied{Satisfaction.IsSatisfied}, ContainsErrors{
47 Satisfaction.ContainsErrors} {
49 CreatUnsatisfiedConstraintRecord(
51 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
56 : NumRecords{Satisfaction.NumRecords},
57 IsSatisfied{Satisfaction.IsSatisfied},
58 ContainsErrors{Satisfaction.ContainsErrors} {
60 CreatUnsatisfiedConstraintRecord(
61 C, *(Satisfaction.
begin() + I),
62 getTrailingObjects<UnsatisfiedConstraintRecord>() + I);
69 totalSizeToAlloc<UnsatisfiedConstraintRecord>(
78 totalSizeToAlloc<UnsatisfiedConstraintRecord>(Satisfaction.
NumRecords);
86 ID.AddPointer(ConstraintOwner);
87 ID.AddInteger(TemplateArgs.size());
88 for (
auto &Arg : TemplateArgs)
99 FoundDecl, NamedConcept, ArgsAsWritten);
110 for (
auto &ArgLoc : ArgsAsWritten->
arguments())
111 ArgLoc.getArgument().print(Policy, OS,
false);
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
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...
llvm::SmallVector< std::pair< const Expr *, Detail >, 4 > Details
Pairs of unsatisfied atomic constraint expressions along with the substituted constraint expr,...
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C)
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.
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...
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.