Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaTemplateDeduction.cpp
Show First 20 Lines • Show All 2,785 Lines • ▼ Show 20 Lines | |||||
template<typename TemplateDeclT> | template<typename TemplateDeclT> | ||||
static Sema::TemplateDeductionResult | static Sema::TemplateDeductionResult | ||||
CheckDeducedArgumentConstraints(Sema& S, TemplateDeclT *Template, | CheckDeducedArgumentConstraints(Sema& S, TemplateDeclT *Template, | ||||
ArrayRef<TemplateArgument> DeducedArgs, | ArrayRef<TemplateArgument> DeducedArgs, | ||||
TemplateDeductionInfo& Info) { | TemplateDeductionInfo& Info) { | ||||
llvm::SmallVector<const Expr *, 3> AssociatedConstraints; | llvm::SmallVector<const Expr *, 3> AssociatedConstraints; | ||||
Template->getAssociatedConstraints(AssociatedConstraints); | Template->getAssociatedConstraints(AssociatedConstraints); | ||||
MultiLevelTemplateArgumentList MLTAL; | |||||
MLTAL.addOuterTemplateArguments(DeducedArgs); | |||||
if (S.CheckConstraintSatisfaction(Template, AssociatedConstraints, | if (S.CheckConstraintSatisfaction(Template, AssociatedConstraints, | ||||
Lint: Pre-merge checks: clang-format: please reformat the code
```
- if (S.CheckConstraintSatisfaction(Template… | |||||
DeducedArgs, Info.getLocation(), | MLTAL, Info.getLocation(), | ||||
Info.AssociatedConstraintsSatisfaction) || | Info.AssociatedConstraintsSatisfaction) || | ||||
!Info.AssociatedConstraintsSatisfaction.IsSatisfied) { | !Info.AssociatedConstraintsSatisfaction.IsSatisfied) { | ||||
Info.reset(TemplateArgumentList::CreateCopy(S.Context, DeducedArgs)); | Info.reset(TemplateArgumentList::CreateCopy(S.Context, DeducedArgs)); | ||||
return Sema::TDK_ConstraintsNotSatisfied; | return Sema::TDK_ConstraintsNotSatisfied; | ||||
} | } | ||||
return Sema::TDK_Success; | return Sema::TDK_Success; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,763 Lines • ▼ Show 20 Lines | TemplateArgs.addArgument( | ||||
Deduced, TypeLoc.getNameLoc()))); | Deduced, TypeLoc.getNameLoc()))); | ||||
for (unsigned I = 0, C = TypeLoc.getNumArgs(); I != C; ++I) | for (unsigned I = 0, C = TypeLoc.getNumArgs(); I != C; ++I) | ||||
TemplateArgs.addArgument(TypeLoc.getArgLoc(I)); | TemplateArgs.addArgument(TypeLoc.getArgLoc(I)); | ||||
llvm::SmallVector<TemplateArgument, 4> Converted; | llvm::SmallVector<TemplateArgument, 4> Converted; | ||||
if (S.CheckTemplateArgumentList(Concept, SourceLocation(), TemplateArgs, | if (S.CheckTemplateArgumentList(Concept, SourceLocation(), TemplateArgs, | ||||
/*PartialTemplateArgs=*/false, Converted)) | /*PartialTemplateArgs=*/false, Converted)) | ||||
return Sema::DAR_FailedAlreadyDiagnosed; | return Sema::DAR_FailedAlreadyDiagnosed; | ||||
MultiLevelTemplateArgumentList MLTAL; | |||||
MLTAL.addOuterTemplateArguments(Converted); | |||||
if (S.CheckConstraintSatisfaction(Concept, {Concept->getConstraintExpr()}, | if (S.CheckConstraintSatisfaction(Concept, {Concept->getConstraintExpr()}, | ||||
Converted, TypeLoc.getLocalSourceRange(), | MLTAL, TypeLoc.getLocalSourceRange(), | ||||
Satisfaction)) | Satisfaction)) | ||||
return Sema::DAR_FailedAlreadyDiagnosed; | return Sema::DAR_FailedAlreadyDiagnosed; | ||||
if (!Satisfaction.IsSatisfied) { | if (!Satisfaction.IsSatisfied) { | ||||
std::string Buf; | std::string Buf; | ||||
llvm::raw_string_ostream OS(Buf); | llvm::raw_string_ostream OS(Buf); | ||||
OS << "'" << Concept->getName(); | OS << "'" << Concept->getName(); | ||||
if (TypeLoc.hasExplicitTemplateArgs()) { | if (TypeLoc.hasExplicitTemplateArgs()) { | ||||
printTemplateArgumentList( | printTemplateArgumentList( | ||||
▲ Show 20 Lines • Show All 1,508 Lines • Show Last 20 Lines |
clang-format: please reformat the code