;
55 const Decl*NextDecl =
nullptr;
57 boolClearRelativeToPrimary =
true;
58 staticResponse Done() {
63 staticResponse ChangeDecl(
const Decl*ND) {
68 staticResponse ChangeDecl(
const DeclContext*Ctx) {
74 staticResponse UseNextDecl(
const Decl*CurDecl) {
78 staticResponse DontClearRelativeToPrimaryNextDecl(
const Decl*CurDecl) {
79Response R = Response::UseNextDecl(CurDecl);
80R.ClearRelativeToPrimary =
false;
89getPrimaryTemplateOfGenericLambda(
const FunctionDecl*LambdaCallOperator) {
91 returnLambdaCallOperator;
93 if(
auto*FTD = dyn_cast_if_present<FunctionTemplateDecl>(
95FTD && FTD->getInstantiatedFromMemberTemplate()) {
97FTD->getInstantiatedFromMemberTemplate()->getTemplatedDecl();
103}
else if(
auto*Prev = cast<CXXMethodDecl>(LambdaCallOperator)
104->getInstantiatedFromMemberFunction())
105LambdaCallOperator = Prev;
109 returnLambdaCallOperator;
112structEnclosingTypeAliasTemplateDetails {
117 explicit operator bool()
noexcept{
returnTemplate; }
122EnclosingTypeAliasTemplateDetails
123getEnclosingTypeAliasTemplateDecl(
Sema&SemaRef) {
126TypeAliasTemplateInstantiation)
128EnclosingTypeAliasTemplateDetails Result;
129 auto*TATD = cast<TypeAliasTemplateDecl>(CSC.Entity),
130*Next = TATD->getInstantiatedFromMemberTemplate();
134CSC.template_arguments(),
137Result.PrimaryTypeAliasDecl = Next;
138Next = Next->getInstantiatedFromMemberTemplate();
151boolisLambdaEnclosedByTypeAliasDecl(
155Visitor(
const FunctionDecl*CallOperator) : CallOperator(CallOperator) {}
156 boolVisitLambdaExpr(
LambdaExpr*LE)
override{
159 returngetPrimaryTemplateOfGenericLambda(LE->getCallOperator()) !=
168 return!Visitor(getPrimaryTemplateOfGenericLambda(LambdaCallOperator))
169.TraverseType(Underlying);
176 boolSkipForSpecialization) {
180 returnResponse::DontClearRelativeToPrimaryNextDecl(VarTemplSpec);
184!isa<VarTemplatePartialSpecializationDecl>(VarTemplSpec))
185 returnResponse::Done();
190llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
194 if(!SkipForSpecialization)
195Result.addOuterTemplateArguments(
198 if(Partial->isMemberSpecialization())
199 returnResponse::Done();
202 if(!SkipForSpecialization)
203Result.addOuterTemplateArguments(
207 returnResponse::Done();
209 returnResponse::DontClearRelativeToPrimaryNextDecl(VarTemplSpec);
221 for(
unsignedI = 0, N = TTP->
getDepth() + 1; I != N; ++I)
222Result.addOuterTemplateArguments(std::nullopt);
223 returnResponse::Done();
226Response HandlePartialClassTemplateSpec(
229 if(!SkipForSpecialization)
231 returnResponse::Done();
238 boolSkipForSpecialization) {
242!isa<ClassTemplatePartialSpecializationDecl>(ClassTemplSpec))
243 returnResponse::Done();
245 if(!SkipForSpecialization)
246Result.addOuterTemplateArguments(
255 returnResponse::Done();
261 if(
auto*InstFromPartialTempl =
264 returnResponse::ChangeDecl(
265InstFromPartialTempl->getLexicalDeclContext());
267 returnResponse::UseNextDecl(ClassTemplSpec);
273 boolForConstraintInstantiation,
274 boolForDefaultArgumentSubstitution) {
276 if(!RelativeToPrimary &&
277 Function->getTemplateSpecializationKindForInstantiation() ==
279 returnResponse::Done();
281 if(!RelativeToPrimary &&
286 returnResponse::UseNextDecl(
Function);
288 Function->getTemplateSpecializationArgs()) {
291TemplateArgs->asArray(),
294 if(RelativeToPrimary &&
295(
Function->getTemplateSpecializationKind() ==
297(
Function->getFriendObjectKind() &&
298!
Function->getPrimaryTemplate()->getFriendObjectKind())))
299 returnResponse::UseNextDecl(
Function);
303assert(
Function->getPrimaryTemplate() &&
"No function template?");
304 if(!ForDefaultArgumentSubstitution &&
305 Function->getPrimaryTemplate()->isMemberSpecialization())
306 returnResponse::Done();
309 if(!ForConstraintInstantiation &&
311 returnResponse::Done();
313}
else if(
Function->getDescribedFunctionTemplate()) {
315(ForConstraintInstantiation || Result.getNumSubstitutedLevels() == 0) &&
316 "Outer template not instantiated?");
322 if((
Function->getFriendObjectKind() ||
Function->isLocalExternDecl()) &&
323 Function->getNonTransparentDeclContext()->isFileContext() &&
325 returnResponse::ChangeDecl(
Function->getLexicalDeclContext());
328 if(ForConstraintInstantiation &&
Function->getFriendObjectKind())
329 returnResponse::ChangeDecl(
Function->getLexicalDeclContext());
330 returnResponse::UseNextDecl(
Function);
333Response HandleFunctionTemplateDecl(
Sema&SemaRef,
336 if(!isa<ClassTemplateSpecializationDecl>(FTD->
getDeclContext())) {
337Result.addOuterTemplateArguments(
345 while(
const Type*Ty = NNS ? NNS->
getAsType() :
nullptr) {
366 if(TSTy->isCurrentInstantiation()) {
367 auto*RD = TSTy->getCanonicalTypeInternal()->getAsCXXRecordDecl();
369Arguments = CTD->getInjectedTemplateArgs(SemaRef.
Context);
371dyn_cast<ClassTemplateSpecializationDecl>(RD))
375Result.addOuterTemplateArguments(
376TSTy->getTemplateName().getAsTemplateDecl(), Arguments,
391 boolForConstraintInstantiation) {
394(ForConstraintInstantiation || Result.getNumSubstitutedLevels() == 0) &&
395 "Outer template not instantiated?");
396 if(ClassTemplate->isMemberSpecialization())
397 returnResponse::Done();
398 if(ForConstraintInstantiation)
399Result.addOuterTemplateArguments(
401ClassTemplate->getInjectedTemplateArgs(SemaRef.
Context),
408 returnResponse::Done();
413 if(ForConstraintInstantiation && IsFriend &&
422 returnResponse::ChangeDecl(LCD);
426 if(
autoTypeAlias = getEnclosingTypeAliasTemplateDecl(SemaRef);
427ForConstraintInstantiation && TypeAlias) {
429TypeAlias.PrimaryTypeAliasDecl)) {
430Result.addOuterTemplateArguments(TypeAlias.Template,
431TypeAlias.AssociatedTemplateArguments,
446 returnResponse::ChangeDecl(TypeAlias.Template->getDeclContext());
451 returnResponse::UseNextDecl(Rec);
454Response HandleImplicitConceptSpecializationDecl(
457Result.addOuterTemplateArguments(
461 returnResponse::UseNextDecl(CSD);
464Response HandleGenericDeclContext(
const Decl*CurDecl) {
465 returnResponse::UseNextDecl(CurDecl);
473 const FunctionDecl*Pattern,
boolForConstraintInstantiation,
474 boolSkipForSpecialization,
boolForDefaultArgumentSubstitution) {
475assert((ND || DC) &&
"Can't find arguments for a decl if one isn't provided");
480 const Decl*CurDecl = ND;
486 Result.addOuterTemplateArguments(
const_cast<NamedDecl*
>(ND), *Innermost,
496 if(
const auto*TTP = dyn_cast<TemplateTemplateParmDecl>(CurDecl))
497HandleDefaultTempArgIntoTempTempParam(TTP,
Result);
498CurDecl = Response::UseNextDecl(CurDecl).NextDecl;
503 if(
const auto*VarTemplSpec =
504dyn_cast<VarTemplateSpecializationDecl>(CurDecl)) {
505R = HandleVarTemplateSpec(VarTemplSpec,
Result, SkipForSpecialization);
506}
else if(
const auto*PartialClassTemplSpec =
507dyn_cast<ClassTemplatePartialSpecializationDecl>(CurDecl)) {
508R = HandlePartialClassTemplateSpec(PartialClassTemplSpec,
Result,
509SkipForSpecialization);
510}
else if(
const auto*ClassTemplSpec =
511dyn_cast<ClassTemplateSpecializationDecl>(CurDecl)) {
512R = HandleClassTemplateSpec(ClassTemplSpec,
Result,
513SkipForSpecialization);
514}
else if(
const auto*
Function= dyn_cast<FunctionDecl>(CurDecl)) {
515R = HandleFunction(*
this,
Function,
Result, Pattern, RelativeToPrimary,
516ForConstraintInstantiation,
517ForDefaultArgumentSubstitution);
518}
else if(
const auto*Rec = dyn_cast<CXXRecordDecl>(CurDecl)) {
520ForConstraintInstantiation);
521}
else if(
const auto*CSD =
522dyn_cast<ImplicitConceptSpecializationDecl>(CurDecl)) {
523R = HandleImplicitConceptSpecializationDecl(CSD,
Result);
524}
else if(
const auto*FTD = dyn_cast<FunctionTemplateDecl>(CurDecl)) {
525R = HandleFunctionTemplateDecl(*
this, FTD,
Result);
526}
else if(
const auto*CTD = dyn_cast<ClassTemplateDecl>(CurDecl)) {
527R = Response::ChangeDecl(CTD->getLexicalDeclContext());
528}
else if(!isa<DeclContext>(CurDecl)) {
529R = Response::DontClearRelativeToPrimaryNextDecl(CurDecl);
530 if(
const auto*TTP = dyn_cast<TemplateTemplateParmDecl>(CurDecl)) {
531R = HandleDefaultTempArgIntoTempTempParam(TTP,
Result);
534R = HandleGenericDeclContext(CurDecl);
539 if(R.ClearRelativeToPrimary)
540RelativeToPrimary =
false;
542CurDecl = R.NextDecl;
586llvm_unreachable(
"Invalid SynthesisKind!");
616AlreadyInstantiating = !Inst.Entity ?
false:
618.insert({Inst.Entity->getCanonicalDecl(), Inst.Kind})
629PointOfInstantiation, InstantiationRange, Entity) {}
636PointOfInstantiation, InstantiationRange, Entity) {}
646Template, TemplateArgs) {}
656TemplateArgs, &DeductionInfo) {
670PointOfInstantiation, InstantiationRange, Template, nullptr,
671TemplateArgs, &DeductionInfo) {}
681PointOfInstantiation, InstantiationRange, PartialSpec, nullptr,
682TemplateArgs, &DeductionInfo) {}
692PointOfInstantiation, InstantiationRange, PartialSpec, nullptr,
693TemplateArgs, &DeductionInfo) {}
701PointOfInstantiation, InstantiationRange, Param, nullptr,
711PointOfInstantiation, InstantiationRange, Param, Template,
721PointOfInstantiation, InstantiationRange, Param, Template,
730PointOfInstantiation, InstantiationRange,
Entity,
731nullptr, TemplateArgs) {}
739PointOfInstantiation, InstantiationRange, Param, Template,
748PointOfInstantiation, InstantiationRange,
nullptr,
749nullptr,
{}, &DeductionInfo) {}
757PointOfInstantiation, InstantiationRange,
nullptr,
765PointOfInstantiation, InstantiationRange,
nullptr,
766nullptr,
{}, &DeductionInfo) {}
774PointOfInstantiation, InstantiationRange, Template, nullptr,
783PointOfInstantiation, InstantiationRange, Template, nullptr,
784{}, &DeductionInfo) {}
792PointOfInstantiation, InstantiationRange, Template) {}
800PointOfInstantiation, InstantiationRange, Template) {}
807PointOfInstantiation, InstantiationRange, Entity) {}
813ArgLoc, InstantiationRange, PArg) {}
821 if(!Ctx.isInstantiationRecord())
831 if(!Active.isInstantiationRecord()) {
841 "forgot to remove a lookup module for a template instantiation");
860 if(!AlreadyInstantiating) {
864{Active.Entity->getCanonicalDecl(), Active.Kind});
878llvm::raw_string_ostream
OS(
Result);
879llvm::ListSeparator Comma;
880 for(
const Expr*Arg : Args) {
882Arg->IgnoreParens()->printPretty(
OS,
nullptr,
888boolSema::InstantiatingTemplate::CheckInstantiationDepth(
899diag::err_template_recursion_depth_exceeded)
901<< InstantiationRange;
902 SemaRef.
Diag(PointOfInstantiation, diag::note_template_recursion_depth)
912SkipStart = Limit / 2 + Limit % 2;
917 unsignedInstantiationIdx = 0;
922++Active, ++InstantiationIdx) {
924 if(InstantiationIdx >= SkipStart && InstantiationIdx < SkipEnd) {
925 if(InstantiationIdx == SkipStart) {
928diag::note_instantiation_contexts_suppressed)
934 switch(Active->Kind) {
936 Decl*
D= Active->Entity;
938 unsignedDiagID = diag::note_template_member_class_here;
939 if(isa<ClassTemplateSpecializationDecl>(
Record))
940DiagID = diag::note_template_class_instantiation_here;
941 Diags.
Report(Active->PointOfInstantiation, DiagID)
942<<
Record<< Active->InstantiationRange;
945 if(
Function->getPrimaryTemplate())
946DiagID = diag::note_function_template_spec_here;
948DiagID = diag::note_template_member_function_here;
949 Diags.
Report(Active->PointOfInstantiation, DiagID)
951<< Active->InstantiationRange;
952}
else if(
VarDecl*VD = dyn_cast<VarDecl>(
D)) {
954VD->isStaticDataMember()?
955diag::note_template_static_data_member_def_here
956: diag::note_template_variable_def_here)
958<< Active->InstantiationRange;
959}
else if(
EnumDecl*ED = dyn_cast<EnumDecl>(
D)) {
961diag::note_template_enum_def_here)
963<< Active->InstantiationRange;
964}
else if(
FieldDecl*FD = dyn_cast<FieldDecl>(
D)) {
966diag::note_template_nsdmi_here)
967<< FD << Active->InstantiationRange;
970diag::note_template_class_instantiation_here)
971<< CTD << Active->InstantiationRange;
977 TemplateDecl*Template = cast<TemplateDecl>(Active->Template);
979llvm::raw_svector_ostream
OS(TemplateArgsStr);
984diag::note_default_arg_instantiation_here)
986<< Active->InstantiationRange;
993diag::note_explicit_template_arg_substitution_here)
996Active->TemplateArgs,
997Active->NumTemplateArgs)
998<< Active->InstantiationRange;
1004dyn_cast<FunctionTemplateDecl>(Active->Entity)) {
1006diag::note_function_template_deduction_instantiation_here)
1009Active->TemplateArgs,
1010Active->NumTemplateArgs)
1011<< Active->InstantiationRange;
1013 boolIsVar = isa<VarTemplateDecl>(Active->Entity) ||
1014isa<VarTemplateSpecializationDecl>(Active->Entity);
1015 boolIsTemplate =
false;
1017 if(
auto*
D= dyn_cast<TemplateDecl>(Active->Entity)) {
1019Params =
D->getTemplateParameters();
1020}
else if(
auto*
D= dyn_cast<ClassTemplatePartialSpecializationDecl>(
1022Params =
D->getTemplateParameters();
1023}
else if(
auto*
D= dyn_cast<VarTemplatePartialSpecializationDecl>(
1025Params =
D->getTemplateParameters();
1027llvm_unreachable(
"unexpected template kind");
1031diag::note_deduced_template_arg_substitution_here)
1032<< IsVar << IsTemplate << cast<NamedDecl>(Active->Entity)
1034Active->NumTemplateArgs)
1035<< Active->InstantiationRange;
1041 ParmVarDecl*Param = cast<ParmVarDecl>(Active->Entity);
1045llvm::raw_svector_ostream
OS(TemplateArgsStr);
1050diag::note_default_function_arg_instantiation_here)
1052<< Active->InstantiationRange;
1057 NamedDecl*Parm = cast<NamedDecl>(Active->Entity);
1059 if(!Parm->
getName().empty())
1060Name = std::string(
" '") + Parm->
getName().str() +
"'";
1063 if(
TemplateDecl*Template = dyn_cast<TemplateDecl>(Active->Template))
1064TemplateParams = Template->getTemplateParameters();
1067cast<ClassTemplatePartialSpecializationDecl>(Active->Template)
1068->getTemplateParameters();
1070diag::note_prior_template_arg_substitution)
1071<< isa<TemplateTemplateParmDecl>(Parm)
1074Active->TemplateArgs,
1075Active->NumTemplateArgs)
1076<< Active->InstantiationRange;
1082 if(
TemplateDecl*Template = dyn_cast<TemplateDecl>(Active->Template))
1083TemplateParams = Template->getTemplateParameters();
1086cast<ClassTemplatePartialSpecializationDecl>(Active->Template)
1087->getTemplateParameters();
1090diag::note_template_default_arg_checking)
1092Active->TemplateArgs,
1093Active->NumTemplateArgs)
1094<< Active->InstantiationRange;
1100diag::note_evaluating_exception_spec_here)
1101<< cast<FunctionDecl>(Active->Entity);
1106diag::note_template_exception_spec_instantiation_here)
1107<< cast<FunctionDecl>(Active->Entity)
1108<< Active->InstantiationRange;
1113diag::note_template_requirement_instantiation_here)
1114<< Active->InstantiationRange;
1118diag::note_template_requirement_params_instantiation_here)
1119<< Active->InstantiationRange;
1124diag::note_nested_requirement_here)
1125<< Active->InstantiationRange;
1130diag::note_in_declaration_of_implicit_special_member)
1131<< cast<CXXRecordDecl>(Active->Entity)
1132<< llvm::to_underlying(Active->SpecialMember);
1137diag::note_in_declaration_of_implicit_equality_comparison);
1143 auto*FD = dyn_cast<FunctionDecl>(Active->Entity);
1147 auto*MD = cast<CXXMethodDecl>(FD);
1149diag::note_member_synthesized_at)
1150<< MD->isExplicitlyDefaulted()
1156.getNonReferenceType()
1157.getUnqualifiedType();
1159diag::note_comparison_synthesized_at)
1167diag::note_rewriting_operator_as_spaceship);
1172diag::note_in_binding_decl_init)
1173<< cast<BindingDecl>(Active->Entity);
1178diag::note_due_to_dllexported_class)
1179<< cast<CXXRecordDecl>(Active->Entity) << !
getLangOpts().CPlusPlus11;
1184diag::note_building_builtin_dump_struct_call)
1186*
this,
llvm::ArrayRef(Active->CallArgs, Active->NumCallArgs));
1194diag::note_lambda_substitution_here);
1197 unsignedDiagID = 0;
1198 if(!Active->Entity) {
1200diag::note_nested_requirement_here)
1201<< Active->InstantiationRange;
1204 if(isa<ConceptDecl>(Active->Entity))
1205DiagID = diag::note_concept_specialization_here;
1206 else if(isa<TemplateDecl>(Active->Entity))
1207DiagID = diag::note_checking_constraints_for_template_id_here;
1208 else if(isa<VarTemplatePartialSpecializationDecl>(Active->Entity))
1209DiagID = diag::note_checking_constraints_for_var_spec_id_here;
1210 else if(isa<ClassTemplatePartialSpecializationDecl>(Active->Entity))
1211DiagID = diag::note_checking_constraints_for_class_spec_id_here;
1213assert(isa<FunctionDecl>(Active->Entity));
1214DiagID = diag::note_checking_constraints_for_function_here;
1217llvm::raw_svector_ostream
OS(TemplateArgsStr);
1219 if(!isa<FunctionDecl>(Active->Entity)) {
1223 Diags.
Report(Active->PointOfInstantiation, DiagID) <<
OS.str()
1224<< Active->InstantiationRange;
1229diag::note_constraint_substitution_here)
1230<< Active->InstantiationRange;
1234diag::note_constraint_normalization_here)
1235<< cast<NamedDecl>(Active->Entity) << Active->InstantiationRange;
1239diag::note_parameter_mapping_substitution_here)
1240<< Active->InstantiationRange;
1244diag::note_building_deduction_guide_here);
1248diag::note_template_type_alias_instantiation_here)
1249<< cast<TypeAliasTemplateDecl>(Active->Entity)
1250<< Active->InstantiationRange;
1254diag::note_template_arg_template_params_mismatch);
1257 Diags.
Report(ParamLoc, diag::note_template_prev_declaration)
1258<<
true<< Active->InstantiationRange;
1266 returnstd::optional<TemplateDeductionInfo *>(
nullptr);
1271Active != ActiveEnd;
1274 switch(Active->Kind) {
1278 if(isa<TypeAliasTemplateDecl>(Active->Entity))
1289 returnstd::nullopt;
1296 returnstd::nullopt;
1318assert(Active->DeductionInfo &&
"Missing deduction info pointer");
1319 returnActive->DeductionInfo;
1330 returnstd::nullopt;
1344 if(Active->SavedInNonInstantiationSFINAEContext)
1345 returnstd::optional<TemplateDeductionInfo *>(
nullptr);
1348 returnstd::nullopt;
1355 classTemplateInstantiator :
public TreeTransform<TemplateInstantiator> {
1360 boolEvaluateConstraints =
true;
1363 boolIsIncomplete =
false;
1365 boolBailOutOnIncomplete;
1370TemplateInstantiator(
Sema&SemaRef,
1373 boolBailOutOnIncomplete =
false)
1374: inherited(SemaRef), TemplateArgs(TemplateArgs),
Loc(
Loc),
1375Entity(Entity), BailOutOnIncomplete(BailOutOnIncomplete) {}
1377 voidsetEvaluateConstraints(
boolB) {
1378EvaluateConstraints = B;
1380 boolgetEvaluateConstraints() {
1381 returnEvaluateConstraints;
1398 boolgetIsIncomplete()
const{
returnIsIncomplete; }
1404this->Entity = Entity;
1407 unsignedTransformTemplateDepth(
unsignedDepth) {
1412 intIndex = getSema().ArgumentPackSubstitutionIndex;
1414 returnstd::nullopt;
1421 bool&ShouldExpand,
bool&RetainExpansion,
1422std::optional<unsigned> &NumExpansions) {
1423 returngetSema().CheckParameterPacksForExpansion(EllipsisLoc,
1424PatternRange, Unexpanded,
1431 voidExpandingFunctionParameterPack(
ParmVarDecl*Pack) {
1441 unsignedDepth, Index;
1444Result = TemplateArgs(Depth, Index);
1447IsIncomplete =
true;
1448 if(BailOutOnIncomplete)
1464 unsignedDepth, Index;
1474 voidtransformAttrs(
Decl*Old,
Decl*New) {
1480(NewDecls.size() != 1 || !NewDecls.front()->isParameterPack())) {
1482 for(
auto*New : NewDecls)
1484Old, cast<VarDecl>(New));
1488assert(NewDecls.size() == 1 &&
1489 "should only have multiple expansions for a pack");
1490 Decl*New = NewDecls.front();
1495 auto*NewMD = dyn_cast<CXXMethodDecl>(New);
1497 auto*OldMD = dyn_cast<CXXMethodDecl>(Old);
1498 if(
auto*NewTD = NewMD->getDescribedFunctionTemplate())
1499NewTD->setInstantiatedFromMemberTemplate(
1500OldMD->getDescribedFunctionTemplate());
1502NewMD->setInstantiationOfMemberFunction(OldMD,
1510 if(
auto*DC = dyn_cast<DeclContext>(Old);
1511DC && DC->isDependentContext() && DC->isFunctionOrMethod())
1552 NamedDecl*FirstQualifierInScope =
nullptr,
1553 boolAllowInjectedClassName =
false);
1555 constAnnotateAttr *TransformAnnotateAttr(
constAnnotateAttr *AA);
1556 constCXXAssumeAttr *TransformCXXAssumeAttr(
constCXXAssumeAttr *AA);
1557 constLoopHintAttr *TransformLoopHintAttr(
constLoopHintAttr *LH);
1558 constNoInlineAttr *TransformStmtNoInlineAttr(
const Stmt*OrigS,
1560 constNoInlineAttr *A);
1561 constAlwaysInlineAttr *
1562TransformStmtAlwaysInlineAttr(
const Stmt*OrigS,
const Stmt*InstS,
1563 constAlwaysInlineAttr *A);
1564 constCodeAlignAttr *TransformCodeAlignAttr(
constCodeAlignAttr *CA);
1571 ExprResultTransformSubstNonTypeTemplateParmPackExpr(
1573 ExprResultTransformSubstNonTypeTemplateParmExpr(
1594 returninherited::TransformFunctionProtoType(TLB, TL);
1599 auto Type= inherited::TransformInjectedClassNameType(TLB, TL);
1602 if(
Type.isNull() &&
1609inherited::TransformType(ICT->getInjectedSpecializationType());
1620 boolUneval =
false) {
1622std::vector<TemplateArgument> TArgs;
1642 returninherited::TransformTemplateArgument(Input, Output, Uneval);
1645 template<
typenameFn>
1650Fn TransformExceptionSpec);
1653TransformFunctionTypeParam(
ParmVarDecl*OldParm,
intindexAdjustment,
1654std::optional<unsigned> NumExpansions,
1655 boolExpectParameterPack);
1657 usinginherited::TransformTemplateTypeParmType;
1662 boolSuppressObjCLifetime);
1664 QualTypeBuildSubstTemplateTypeParmType(
1666 Decl*AssociatedDecl,
unsignedIndex, std::optional<unsigned> PackIndex,
1672 usinginherited::TransformSubstTemplateTypeParmPackType;
1676 boolSuppressObjCLifetime);
1682 if(
Type->getSubstitutionFlag() !=
1683SubstTemplateTypeParmTypeFlag::ExpandPacksInPlace)
1684 returninherited::TransformSubstTemplateTypeParmType(TLB, TL);
1686assert(
Type->getPackIndex());
1688 Type->getReplacedParameter()->getDepth(),
Type->getIndex());
1693 returninherited::TransformSubstTemplateTypeParmType(TLB, TL);
1698 if(
autoTypeAlias =
1699TemplateInstArgsHelpers::getEnclosingTypeAliasTemplateDecl(
1701 TypeAlias&& TemplateInstArgsHelpers::isLambdaEnclosedByTypeAliasDecl(
1703 unsignedTypeAliasDeclDepth =
TypeAlias.Template->getTemplateDepth();
1705 returnCXXRecordDecl::LambdaDependencyKind::LDK_AlwaysDependent;
1708 returnCXXRecordDecl::LambdaDependencyKind::LDK_AlwaysDependent;
1710 returninherited::ComputeLambdaDependency(LSI);
1722 returninherited::TransformLambdaExpr(
E);
1728 returninherited::TransformBlockExpr(
E);
1735assert(PVD &&
"null in a parameter list");
1736 if(!PVD->hasDefaultArg())
1738 Expr*UninstExpr = PVD->getUninstantiatedDefaultArg();
1749PVD->setDefaultArg(ErrorResult.
get());
1752 returninherited::RebuildLambdaExpr(StartLoc, EndLoc, LSI);
1766 returninherited::TransformLambdaBody(
E, Body);
1771 ExprResultTransReq = inherited::TransformRequiresExpr(
E);
1774assert(TransReq.
get() !=
E&&
1775 "Do not change value of isSatisfied for the existing expression. " 1776 "Create a new expression instead.");
1777 if(
E->getBody()->isDependentContext()) {
1783 if(Trap.hasErrorOccurred())
1789 boolTransformRequiresExprRequirements(
1792 boolSatisfactionDetermined =
false;
1795 if(!SatisfactionDetermined) {
1796 if(
auto*TypeReq = dyn_cast<concepts::TypeRequirement>(Req))
1797TransReq = TransformTypeRequirement(TypeReq);
1798 else if(
auto*ExprReq = dyn_cast<concepts::ExprRequirement>(Req))
1799TransReq = TransformExprRequirement(ExprReq);
1801TransReq = TransformNestedRequirement(
1802cast<concepts::NestedRequirement>(Req));
1811SatisfactionDetermined =
true;
1814Transformed.push_back(TransReq);
1821 if(!OrigTPL || !OrigTPL->
size())
returnOrigTPL;
1825Owner, TemplateArgs);
1826DeclInstantiator.setEvaluateConstraints(EvaluateConstraints);
1827 returnDeclInstantiator.SubstTemplateParams(OrigTPL);
1845transformNonTypeTemplateParmRef(
Decl*AssociatedDecl,
1848std::optional<unsigned> PackIndex);
1852boolTemplateInstantiator::AlreadyTransformed(
QualType T) {
1860getSema().MarkDeclarationsReferencedInType(
Loc,
T);
1885TTP->getPosition())) {
1886IsIncomplete =
true;
1887 returnBailOutOnIncomplete ? nullptr :
D;
1892 if(TTP->isParameterPack()) {
1894 "Missing argument pack");
1900 "Wrong kind of template template argument");
1912 Decl*Inst = getSema().SubstDecl(
D, getSema().
CurContext, TemplateArgs);
1916getSema().CurrentInstantiationScope->InstantiatedLocal(
D, Inst);
1920boolTemplateInstantiator::TransformExceptionSpec(
1927 returninherited::TransformExceptionSpec(
Loc, ESI, Exceptions, Changed);
1931TemplateInstantiator::TransformFirstQualifierInScope(
NamedDecl*
D,
1945 "Missing argument pack");
1955 returncast_or_null<NamedDecl>(TransformDecl(
Loc,
D));
1958 return Tag->getDecl();
1961getSema().Diag(
Loc, diag::err_nested_name_spec_non_tag) <<
T;
1966 returncast_or_null<NamedDecl>(TransformDecl(
Loc,
D));
1970TemplateInstantiator::RebuildExceptionDecl(
VarDecl*ExceptionDecl,
1976StartLoc, NameLoc, Name);
1978getSema().CurrentInstantiationScope->InstantiatedLocal(ExceptionDecl, Var);
1982VarDecl*TemplateInstantiator::RebuildObjCExceptionDecl(
VarDecl*ExceptionDecl,
1985 VarDecl*Var = inherited::RebuildObjCExceptionDecl(ExceptionDecl, TSInfo,
T);
1987getSema().CurrentInstantiationScope->InstantiatedLocal(ExceptionDecl, Var);
1992TemplateInstantiator::RebuildElaboratedType(
SourceLocationKeywordLoc,
2009TagLocation,
Id)) {
2010 SemaRef.
Diag(TagLocation, diag::err_use_with_wrong_tag)
2019 returninherited::RebuildElaboratedType(KeywordLoc, Keyword, QualifierLoc,
T);
2022TemplateNameTemplateInstantiator::TransformTemplateName(
2025 boolAllowInjectedClassName) {
2027= dyn_cast_or_null<TemplateTemplateParmDecl>(Name.getAsTemplateDecl())) {
2034TTP->getPosition())) {
2035IsIncomplete =
true;
2046 "unexpected pack arguments in template rewrite");
2050 "unexpected nontype template argument kind in template rewrite");
2054 auto[AssociatedDecl, Final] =
2056std::optional<unsigned> PackIndex;
2059 "Missing argument pack");
2065 returngetSema().Context.getSubstTemplateTemplateParmPack(
2066Arg, AssociatedDecl, TTP->
getIndex(), Final);
2069PackIndex = getPackIndex(Arg);
2074assert(!Template.
isNull() &&
"Null template template argument");
2078 returngetSema().Context.getSubstTemplateTemplateParm(
2079Template, AssociatedDecl, TTP->
getIndex(), PackIndex);
2084= Name.getAsSubstTemplateTemplateParmPack()) {
2091 if(SubstPack->getFinal())
2093 returngetSema().Context.getSubstTemplateTemplateParm(
2094Template, SubstPack->getAssociatedDecl(), SubstPack->getIndex(),
2095getPackIndex(Pack));
2098 returninherited::TransformTemplateName(SS, Name, NameLoc, ObjectType,
2099FirstQualifierInScope,
2100AllowInjectedClassName);
2108 returngetSema().BuildPredefinedExpr(
E->getLocation(),
E->getIdentKind());
2112TemplateInstantiator::TransformTemplateParmRefExpr(
DeclRefExpr*
E,
2120IsIncomplete =
true;
2121 returnBailOutOnIncomplete ?
ExprError() :
E;
2131 "unexpected pack arguments in template rewrite");
2135 "unexpected nontype template argument kind in template rewrite");
2142std::optional<unsigned> PackIndex;
2145 "Missing argument pack");
2154 if(TargetType.
isNull())
2163 E->getLocation(), Arg, AssociatedDecl, NTTP->
getPosition());
2165PackIndex = getPackIndex(Arg);
2169 returntransformNonTypeTemplateParmRef(AssociatedDecl, NTTP,
E->getLocation(),
2174TemplateInstantiator::TransformAnnotateAttr(
constAnnotateAttr *AA) {
2176 for(
Expr*Arg : AA->args()) {
2177 ExprResultRes = getDerived().TransformExpr(Arg);
2179Args.push_back(Res.
get());
2181 returnAnnotateAttr::CreateImplicit(getSema().
Context, AA->getAnnotation(),
2182Args.data(), Args.size(), AA->getRange());
2185constCXXAssumeAttr *
2186TemplateInstantiator::TransformCXXAssumeAttr(
constCXXAssumeAttr *AA) {
2187 ExprResultRes = getDerived().TransformExpr(AA->getAssumption());
2191Res = getSema().ActOnFinishFullExpr(Res.
get(),
2196 if(!(Res.
get()->
getDependence() & ExprDependence::TypeValueInstantiation)) {
2197Res = getSema().BuildCXXAssumeExpr(Res.
get(), AA->getAttrName(),
2203 returnCXXAssumeAttr::CreateImplicit(getSema().
Context, Res.
get(),
2208TemplateInstantiator::TransformLoopHintAttr(
constLoopHintAttr *LH) {
2209 Expr*TransformedExpr = getDerived().TransformExpr(LH->getValue()).get();
2211 if(TransformedExpr == LH->getValue())
2216LH->getSemanticSpelling() ==
2217LoopHintAttr::Pragma_unroll))
2220LoopHintAttr::OptionType Option = LH->getOption();
2221LoopHintAttr::LoopHintState State = LH->getState();
2223llvm::APSInt ValueAPS =
2226 if(ValueAPS.isZero() || ValueAPS.isOne()) {
2227Option = LoopHintAttr::Unroll;
2228State = LoopHintAttr::Disable;
2233 returnLoopHintAttr::CreateImplicit(getSema().
Context, Option, State,
2234TransformedExpr, *LH);
2236constNoInlineAttr *TemplateInstantiator::TransformStmtNoInlineAttr(
2237 const Stmt*OrigS,
const Stmt*InstS,
constNoInlineAttr *A) {
2243constAlwaysInlineAttr *TemplateInstantiator::TransformStmtAlwaysInlineAttr(
2244 const Stmt*OrigS,
const Stmt*InstS,
constAlwaysInlineAttr *A) {
2251constCodeAlignAttr *
2252TemplateInstantiator::TransformCodeAlignAttr(
constCodeAlignAttr *CA) {
2253 Expr*TransformedExpr = getDerived().TransformExpr(CA->getAlignment()).get();
2254 returngetSema().BuildCodeAlignAttr(*CA, TransformedExpr);
2257ExprResultTemplateInstantiator::transformNonTypeTemplateParmRef(
2260std::optional<unsigned> PackIndex) {
2265 autoSubstParamType = [&] {
2272 T= cast<PackExpansionType>(
T)->getPattern();
2276 boolrefParam =
false;
2282 Expr*argExpr =
arg.getAsExpr();
2287 QualTypeparamType = SubstParamType();
2288 if(paramType.
isNull())
2302VD = cast_or_null<ValueDecl>(
2308 QualTypeparamType =
arg.getNonTypeTemplateArgumentType();
2309assert(!paramType.
isNull() &&
"type substitution failed for param type");
2310assert(!paramType->
isDependentType() &&
"param type still dependent");
2314 QualTypeparamType =
arg.getNonTypeTemplateArgumentType();
2325 Expr*resultExpr = result.
get();
2329AssociatedDecl, parm->
getIndex(), PackIndex, refParam);
2333TemplateInstantiator::TransformSubstNonTypeTemplateParmPackExpr(
2343 returntransformNonTypeTemplateParmRef(
2344 E->getAssociatedDecl(),
E->getParameterPack(),
2345 E->getParameterPackLocation(), Arg, getPackIndex(Pack));
2349TemplateInstantiator::TransformSubstNonTypeTemplateParmExpr(
2351 ExprResultSubstReplacement =
E->getReplacement();
2352 if(!isa<ConstantExpr>(SubstReplacement.
get()))
2353SubstReplacement = TransformExpr(
E->getReplacement());
2383SugaredConverted, CanonicalConverted,
2387 returntransformNonTypeTemplateParmRef(
E->getAssociatedDecl(),
2389SugaredConverted,
E->getPackIndex());
2395 returngetSema().BuildDeclarationNameExpr(
CXXScopeSpec(), NameInfo, PD);
2406 returnRebuildVarDeclRefExpr(VD,
E->
getExprLoc());
2416Vars.reserve(
E->getNumExpansions());
2422Vars.push_back(
D);
2427 E->getParameterPackLocation(), Vars);
2428getSema().MarkFunctionParmPackReferenced(PackExpr);
2433TemplateInstantiator::TransformFunctionParmPackRefExpr(
DeclRefExpr*
E,
2436llvm::PointerUnion<Decl *, DeclArgumentPack *> *
Found 2437= getSema().CurrentInstantiationScope->findInstantiationOf(PD);
2438assert(
Found&&
"no instantiation for parameter pack");
2440 Decl*TransformedDecl;
2441 if(DeclArgumentPack *Pack =
Found->dyn_cast<DeclArgumentPack *>()) {
2450getSema().MarkFunctionParmPackReferenced(PackExpr);
2454TransformedDecl = (*Pack)[getSema().ArgumentPackSubstitutionIndex];
2456TransformedDecl = cast<Decl *>(*
Found);
2460 returnRebuildVarDeclRefExpr(cast<VarDecl>(TransformedDecl),
E->
getExprLoc());
2464TemplateInstantiator::TransformDeclRefExpr(
DeclRefExpr*
E) {
2471 returnTransformTemplateParmRefExpr(
E, NTTP);
2478 if(
VarDecl*PD = dyn_cast<VarDecl>(
D))
2480 returnTransformFunctionParmPackRefExpr(
E, PD);
2483BD = cast_or_null<BindingDecl>(TransformDecl(BD->getLocation(), BD));
2487dyn_cast_if_present<ResolvedUnexpandedPackExpr>(BD->getBinding()))
2488 returnTransformResolvedUnexpandedPackExpr(RP);
2491 returninherited::TransformDeclRefExpr(
E);
2494ExprResultTemplateInstantiator::TransformCXXDefaultArgExpr(
2496assert(!cast<FunctionDecl>(
E->getParam()->getDeclContext())->
2497getDescribedFunctionTemplate() &&
2498 "Default arg expressions are never formed in dependent cases.");
2500 E->getUsedLocation(), cast<FunctionDecl>(
E->getParam()->getDeclContext()),
2504template<
typenameFn>
2509Fn TransformExceptionSpec) {
2518std::optional<LocalInstantiationScope>
Scope;
2519 if(!Current || !Current->isLambdaOrBlock())
2522 returninherited::TransformFunctionProtoType(
2523TLB, TL, ThisContext, ThisTypeQuals, TransformExceptionSpec);
2526ParmVarDecl*TemplateInstantiator::TransformFunctionTypeParam(
2528std::optional<unsigned> NumExpansions,
boolExpectParameterPack) {
2530OldParm, TemplateArgs, indexAdjustment, NumExpansions,
2531ExpectParameterPack, EvaluateConstraints);
2537QualTypeTemplateInstantiator::BuildSubstTemplateTypeParmType(
2539 Decl*AssociatedDecl,
unsignedIndex, std::optional<unsigned> PackIndex,
2545 if(SuppressObjCLifetime) {
2547RQs = Replacement.getQualifiers();
2558 QualType Result= getSema().Context.getSubstTemplateTypeParmType(
2559Replacement, AssociatedDecl, Index, PackIndex);
2567TemplateInstantiator::TransformTemplateTypeParmType(
TypeLocBuilder&TLB,
2569 boolSuppressObjCLifetime) {
2580IsIncomplete =
true;
2581 if(BailOutOnIncomplete)
2597 "unexpected pack arguments in template rewrite");
2601 "unexpected nontype template argument kind in template rewrite");
2607 auto[AssociatedDecl, Final] =
2609std::optional<unsigned> PackIndex;
2610 if(
T->isParameterPack()) {
2612 "Missing argument pack");
2618 QualType Result= getSema().Context.getSubstTemplateTypeParmPackType(
2619AssociatedDecl,
T->getIndex(), Final, Arg);
2627PackIndex = getPackIndex(Arg);
2632 "Template argument kind mismatch");
2634 returnBuildSubstTemplateTypeParmType(TLB, SuppressObjCLifetime, Final,
2635AssociatedDecl,
T->getIndex(),
2645NewTTPDecl = cast_or_null<TemplateTypeParmDecl>(
2646TransformDecl(TL.
getNameLoc(), OldTTPDecl));
2649 T->isParameterPack(), NewTTPDecl);
2655ExprResultTemplateInstantiator::TransformResolvedUnexpandedPackExpr(
2659 E->getNumExprs() &&
2660 "ArgumentPackSubstitutionIndex is out of range");
2661 returnTransformExpr(
2665 returninherited::TransformResolvedUnexpandedPackExpr(
E);
2668QualTypeTemplateInstantiator::TransformSubstTemplateTypeParmPackType(
2670 boolSuppressObjCLifetime) {
2673 Decl*NewReplaced = TransformDecl(TL.
getNameLoc(),
T->getAssociatedDecl());
2678 if(NewReplaced !=
T->getAssociatedDecl())
2679 Result= getSema().Context.getSubstTemplateTypeParmPackType(
2680NewReplaced,
T->getIndex(),
T->getFinal(),
T->getArgumentPack());
2689 returnBuildSubstTemplateTypeParmType(
2690TLB, SuppressObjCLifetime,
T->getFinal(), NewReplaced,
T->getIndex(),
2704ErrorLoc = PDA.first;
2709llvm::raw_svector_ostream
OS(Entity);
2713 C.backupStr(Entity), ErrorLoc,
C.backupStr(Message)};
2719llvm::raw_svector_ostream
OS(Entity);
2723 C.backupStr(Entity),
2724Location,
StringRef()};
2727ExprResultTemplateInstantiator::TransformRequiresTypeParams(
2741 if(getDerived().TransformFunctionTypeParams(
2742KWLoc, Params,
nullptr,
nullptr, PTypes,
2743&TransParams, PInfos, &ErrorIdx) ||
2744Trap.hasErrorOccurred()) {
2750 SemaRef, Info, [&](llvm::raw_ostream &
OS) {
OS<< *FailedDecl; })));
2751 returngetDerived().RebuildRequiresExpr(KWLoc, Body, RE->
getLParenLoc(),
2753TransReqs, RBraceLoc);
2764 if(AlwaysRebuild())
2765 returnRebuildTypeRequirement(
2775 if(TypeInst.isInvalid())
2778 if(!TransType || Trap.hasErrorOccurred())
2780[&] (llvm::raw_ostream&
OS) {
2783 returnRebuildTypeRequirement(TransType);
2793llvm::PointerUnion<Expr *, concepts::Requirement::SubstitutionDiagnostic *>
2802 if(ExprInst.isInvalid())
2805 if(!TransExprRes.
isInvalid() && !Trap.hasErrorOccurred() &&
2808 if(TransExprRes.
isInvalid() || Trap.hasErrorOccurred())
2813TransExpr = TransExprRes.
get();
2816std::optional<concepts::ExprRequirement::ReturnTypeRequirement> TransRetReq;
2818 if(RetReq.isEmpty())
2819TransRetReq.emplace();
2820 else if(RetReq.isSubstitutionFailure())
2821TransRetReq.emplace(RetReq.getSubstitutionDiagnostic());
2822 else if(RetReq.isTypeConstraint()) {
2824RetReq.getTypeConstraintTemplateParameterList();
2828 if(TPLInst.isInvalid())
2831 if(!TPL || Trap.hasErrorOccurred())
2833[&] (llvm::raw_ostream&
OS) {
2834RetReq.getTypeConstraint()->getImmediatelyDeclaredConstraint()
2839TransRetReq.emplace(TPL);
2842assert(TransRetReq &&
"All code paths leading here must set TransRetReq");
2843 if(
Expr*
E= TransExpr.dyn_cast<
Expr*>())
2845std::move(*TransRetReq));
2846 returnRebuildExprRequirement(
2847cast<concepts::Requirement::SubstitutionDiagnostic *>(TransExpr),
2852TemplateInstantiator::TransformNestedRequirement(
2857 if(AlwaysRebuild())
2866 if(!getEvaluateConstraints()) {
2868 if(TransConstraint.
isInvalid() || !TransConstraint.
get())
2888 if(ConstrInst.isInvalid())
2892 nullptr, {Req->getConstraintExpr()},
Result, TemplateArgs,
2895TransConstraint =
Result[0];
2896assert(!Trap.hasErrorOccurred() &&
"Substitution failures must be handled " 2897 "by CheckConstraintSatisfaction.");
2900 if(TransConstraint.
isUsable() &&
2903 if(TransConstraint.
isInvalid() || !TransConstraint.
get() ||
2906llvm::raw_svector_ostream
OS(Entity);
2920 boolAllowDeducedTST) {
2922 "Cannot perform an instantiation without some context on the " 2923 "instantiation stack");
2929TemplateInstantiator Instantiator(*
this, Args,
Loc, Entity);
2930 returnAllowDeducedTST ? Instantiator.TransformTypeWithDeducedTST(
T)
2931: Instantiator.TransformType(
T);
2939 "Cannot perform an instantiation without some context on the " 2940 "instantiation stack");
2954TemplateInstantiator Instantiator(*
this, Args,
Loc, Entity);
2968 bool*IsIncompleteSubstitution) {
2970 "Cannot perform an instantiation without some context on the " 2971 "instantiation stack");
2978TemplateInstantiator Instantiator(
2979*
this, TemplateArgs,
Loc, Entity,
2980IsIncompleteSubstitution !=
nullptr);
2981 QualTypeQT = Instantiator.TransformType(
T);
2982 if(IsIncompleteSubstitution && Instantiator.getIsIncomplete())
2983*IsIncompleteSubstitution =
true;
2992 TypeLocTL =
T->getTypeLoc().IgnoreParens();
2999 if(!
P)
continue;
3015 boolEvaluateConstraints) {
3017 "Cannot perform an instantiation without some context on the " 3018 "instantiation stack");
3023TemplateInstantiator Instantiator(*
this, Args,
Loc, Entity);
3024Instantiator.setEvaluateConstraints(EvaluateConstraints);
3040 Result= Instantiator.TransformFunctionProtoType(
3041TLB, Proto, ThisContext, ThisTypeQuals,
3043 bool&Changed) {
return false; });
3045 Result= Instantiator.TransformType(TLB, TL);
3059 boolChanged =
false;
3061 returnInstantiator.TransformExceptionSpec(
Loc, ESI, ExceptionStorage,
3072ESI, ExceptionStorage, Args))
3081 structGetContainedInventedTypeParmVisitor :
3082 public TypeVisitor<GetContainedInventedTypeParmVisitor,
3083TemplateTypeParmDecl *> {
3084 using TypeVisitor<GetContainedInventedTypeParmVisitor,
3090 returnVisit(
T.getTypePtr());
3095 if(!
T->getDecl() || !
T->getDecl()->isImplicit())
3097 return T->getDecl();
3104 returnVisit(
T->getNamedType());
3116 returnVisit(
T->getPointeeTypeAsWritten());
3124 returnVisit(
T->getElementType());
3129 returnVisit(
T->getElementType());
3133 returnVisit(
T->getElementType());
3137 returnVisitFunctionType(
T);
3145 returnVisit(
T->getInnerType());
3149 returnVisit(
T->getModifiedType());
3153 returnVisit(
T->getUnderlyingType());
3157 returnVisit(
T->getOriginalType());
3161 returnVisit(
T->getPattern());
3169structExpandPackedTypeConstraints
3176ExpandPackedTypeConstraints(
3178: inherited(SemaRef), TemplateArgs(TemplateArgs) {}
3180 usinginherited::TransformTemplateTypeParmType;
3185 if(!
T->isParameterPack()) {
3196std::optional<unsigned> PackIndex;
3201TL.
getType(),
T->getDecl(),
T->getIndex(), PackIndex,
3202SubstTemplateTypeParmTypeFlag::ExpandPacksInPlace);
3212 if(
T->getPackIndex()) {
3218 returninherited::TransformSubstTemplateTypeParmType(TLB, TL);
3223 returninherited::TransformTemplateArguments(Args.begin(), Args.end(), Out);
3232 boolEvaluateConstraints) {
3236 if(!EvaluateConstraints) {
3237 boolShouldExpandExplicitTemplateArgs =
3239llvm::any_of(TemplArgInfo->
arguments(), [](
auto&Arg) {
3240return Arg.getArgument().containsUnexpandedParameterPack();
3257 if(ShouldExpandExplicitTemplateArgs) {
3261 if(ExpandPackedTypeConstraints(*
this, TemplateArgs)
3269 if(
auto*FE = dyn_cast<CXXFoldExpr>(ConstraintExpr)) {
3270assert(FE->getLHS());
3271ConstraintExpr = FE->getLHS();
3273 auto*CSE = cast<ConceptSpecializationExpr>(ConstraintExpr);
3274assert(!CSE->getTemplateArguments().empty() &&
3275 "Empty template arguments?");
3276ConstrainedType = CSE->getTemplateArguments()[0].getAsType();
3277assert(!ConstrainedType.
isNull() &&
3278 "Failed to extract the original ConstrainedType?");
3284Inst, ConstrainedType,
3317 intindexAdjustment, std::optional<unsigned> NumExpansions,
3318 boolExpectParameterPack,
boolEvaluateConstraint) {
3327NewDI =
SubstType(ExpansionTL.getPatternLoc(), TemplateArgs,
3338}
else if(ExpectParameterPack) {
3344diag::err_function_parameter_pack_without_parameter_packs)
3368GetContainedInventedTypeParmVisitor().Visit(OldDI->
getType())) {
3370 auto*Inst = cast_or_null<TemplateTypeParmDecl>(
3375 if(Inst && !Inst->getTypeConstraint()) {
3444 "Cannot perform an instantiation without some context on the " 3445 "instantiation stack");
3447TemplateInstantiator Instantiator(*
this, TemplateArgs,
Loc,
3449 returnInstantiator.TransformFunctionTypeParams(
3450 Loc, Params,
nullptr, ExtParamInfos, ParamTypes, OutParams, ParamInfos);
3468 Diag(Param->
getBeginLoc(), diag::err_recursive_default_argument) << FD;
3480std::unique_ptr<LocalInstantiationScope> LIS;
3488LIS = std::make_unique<LocalInstantiationScope>(*
this);
3491 if(addInstantiatedParametersToScope(FD, PatternFD, *LIS, TemplateArgs))
3500 if(
Result.isInvalid())
3513 Result= InitSeq.Perform(*
this, Entity, Kind, ResultE);
3514 if(
Result.isInvalid())
3525 if(
Result.isInvalid())
3540 for(
const auto&
Base: Pattern->
bases()) {
3541 if(!
Base.getType()->isDependentType()) {
3543 if(RD->isInvalidDecl())
3552 if(
Base.isPackExpansion()) {
3558 boolShouldExpand =
false;
3559 boolRetainExpansion =
false;
3560std::optional<unsigned> NumExpansions;
3562 Base.getSourceRange(),
3564TemplateArgs, ShouldExpand,
3573 for(
unsignedI = 0; I != *NumExpansions; ++I) {
3578 Base.getSourceRange().getBegin(),
3587 Base.getSourceRange(),
3589 Base.getAccessSpecifierAsWritten(),
3592InstantiatedBases.push_back(InstantiatedBase);
3601EllipsisLoc =
Base.getEllipsisLoc();
3605 Base.getSourceRange().getBegin(),
3610 Base.getSourceRange().getBegin(),
3621 Base.getSourceRange(),
3623 Base.getAccessSpecifierAsWritten(),
3626InstantiatedBases.push_back(InstantiatedBase);
3658Pattern, PatternDef, TSK, Complain))
3661llvm::TimeTraceScope TimeScope(
"InstantiateClass", [&]() {
3662llvm::TimeTraceMetadata M;
3663llvm::raw_string_ostream
OS(M.Detail);
3666 if(llvm::isTimeTraceVerbose()) {
3674Pattern = PatternDef;
3680MSInfo->setPointOfInstantiation(PointOfInstantiation);
3682= dyn_cast<ClassTemplateSpecializationDecl>(Instantiation)) {
3683Spec->setTemplateSpecializationKind(TSK);
3684Spec->setPointOfInstantiation(PointOfInstantiation);
3692 "instantiating class definition");
3710SavePendingParsedClassStateRAII SavedPendingParsedClassState(*
this);
3736 boolMightHaveConstexprVirtualFunctions =
false;
3747 if(
Member->getDeclContext() != Pattern)
3754 if(isa<BlockDecl>(
Member) ||
3755(isa<CXXRecordDecl>(
Member) && cast<CXXRecordDecl>(
Member)->isLambda()))
3758 if(
Member->isInvalidDecl()) {
3765 if(
FieldDecl*Field = dyn_cast<FieldDecl>(NewMember)) {
3766Fields.push_back(Field);
3767}
else if(
EnumDecl*
Enum= dyn_cast<EnumDecl>(NewMember)) {
3773 Enum->isCompleteDefinition()) {
3775assert(MSInfo &&
"no spec info for member enum specialization");
3779}
else if(
StaticAssertDecl*SA = dyn_cast<StaticAssertDecl>(NewMember)) {
3780 if(SA->isFailed()) {
3786}
else if(
CXXMethodDecl*MD = dyn_cast<CXXMethodDecl>(NewMember)) {
3789MightHaveConstexprVirtualFunctions =
true;
3810 if(ParsingClassDepth == 0)
3815 for(LateInstantiatedAttrVec::iterator I = LateAttrs.begin(),
3816 E= LateAttrs.end(); I !=
E; ++I) {
3821 auto*ND = cast<NamedDecl>(I->NewDecl);
3822 auto*ThisContext = dyn_cast_or_null<CXXRecordDecl>(ND->getDeclContext());
3824ND->isCXXInstanceMember());
3829I->NewDecl->addAttr(NewAttr);
3858 P->first,
P->second)) {
3871 P->first,
P->second)) {
3879SavedContext.
pop();
3888 else if(MightHaveConstexprVirtualFunctions)
3905Pattern, PatternDef, TSK,
true))
3907Pattern = PatternDef;
3913MSInfo->setPointOfInstantiation(PointOfInstantiation);
3922 "instantiating enum definition");
3943SavedContext.
pop();
3957 "pattern and instantiation disagree about init style");
3965 Diag(PointOfInstantiation,
3966diag::err_default_member_initializer_not_yet_parsed)
3967<< OutermostClass << Pattern;
3968 Diag(Pattern->getEndLoc(),
3969diag::note_default_member_initializer_not_yet_parsed);
3979 Diag(PointOfInstantiation, diag::err_default_member_initializer_cycle)
3984 "instantiating default member init");
3992PointOfInstantiation, Instantiation,
CurContext};
4003assert((!
Init|| !isa<ParenListExpr>(
Init)) &&
"call-style init in class");
4008L->DefaultMemberInitializerInstantiated(Instantiation);
4017 structPartialSpecMatchResult {
4043!CTPSD->getMostRecentDecl()->isMemberSpecialization())
4063 boolPrimaryHasMatchedPackOnParmToNonPackOnArg) {
4073 if(!isa<ClassTemplatePartialSpecializationDecl *>(Specialized)) {
4102!Partial->getMostRecentDecl()->isMemberSpecialization())
4121 if(Matched.empty() && PrimaryHasMatchedPackOnParmToNonPackOnArg)
4122Matched = std::move(ExtraMatched);
4128 if(Matched.size() >= 1) {
4130 if(Matched.size() == 1) {
4143PEnd = Matched.end();
4146 P->Partial, Best->Partial, PointOfInstantiation) ==
4153 boolAmbiguous =
false;
4155PEnd = Matched.end();
4158 P->Partial, Best->Partial,
4159PointOfInstantiation) != Best->Partial) {
4169S.
Diag(PointOfInstantiation,
4170diag::err_partial_spec_ordering_ambiguous)
4171<< ClassTemplateSpec;
4175PEnd = Matched.end();
4177S.
Diag(
P->Partial->getLocation(), diag::note_partial_spec_match)
4179 P->Partial->getTemplateParameters(), *
P->Args);
4194 if(
auto*PartialSpec =
4197 while(PartialSpec->getInstantiatedFromMember()) {
4200 if(PartialSpec->isMemberSpecialization())
4203PartialSpec = PartialSpec->getInstantiatedFromMember();
4205Pattern = PartialSpec;
4226 boolPrimaryHasMatchedPackOnParmToNonPackOnArg) {
4228ClassTemplateSpec = cast<ClassTemplateSpecializationDecl>(
4235*
this, PointOfInstantiation, ClassTemplateSpec, TSK,
4236PrimaryHasMatchedPackOnParmToNonPackOnArg);
4241PointOfInstantiation, ClassTemplateSpec, Pattern.
get(),
4257 "Unexpected template specialization kind!");
4258 for(
auto*
D: Instantiation->
decls()) {
4259 boolSuppressNew =
false;
4260 if(
auto*
Function= dyn_cast<FunctionDecl>(
D)) {
4262 Function->getInstantiatedFromMemberFunction()) {
4264 if(
Function->isIneligibleOrNotSelected())
4267 if(
Function->getTrailingRequiresClause()) {
4275 if(
Function->hasAttr<ExcludeFromExplicitInstantiationAttr>())
4279 Function->getTemplateSpecializationKind();
4284PointOfInstantiation, TSK,
Function, PrevTSK,
4285 Function->getPointOfInstantiation(), SuppressNew) ||
4298 Function->setTemplateSpecializationKind(TSK, PointOfInstantiation);
4308std::make_pair(
Function, PointOfInstantiation));
4311}
else if(
auto*Var = dyn_cast<VarDecl>(
D)) {
4312 if(isa<VarTemplateSpecializationDecl>(Var))
4316 if(Var->
hasAttr<ExcludeFromExplicitInstantiationAttr>())
4320assert(MSInfo &&
"No member specialization information?");
4349}
else if(
auto*
Record= dyn_cast<CXXRecordDecl>(
D)) {
4350 if(
Record->hasAttr<ExcludeFromExplicitInstantiationAttr>())
4358 if(
Record->isInjectedClassName() ||
Record->getPreviousDecl() ||
4363assert(MSInfo &&
"No member specialization information?");
4389assert(Pattern &&
"Missing instantiated-from-template information");
4391 if(!
Record->getDefinition()) {
4412 Record->getTemplateSpecializationKind() ==
4414 Record->setTemplateSpecializationKind(TSK);
4419Pattern = cast_or_null<CXXRecordDecl>(
Record->getDefinition());
4423}
else if(
auto*
Enum= dyn_cast<EnumDecl>(
D)) {
4425assert(MSInfo &&
"No member specialization information?");
4432PointOfInstantiation, TSK,
Enum,
4438 if(
Enum->getDefinition())
4441 EnumDecl*Pattern =
Enum->getTemplateInstantiationPattern();
4442assert(Pattern &&
"Missing instantiated-from-template information");
4453}
else if(
auto*Field = dyn_cast<FieldDecl>(
D)) {
4460ClassPattern->
lookup(Field->getDeclName());
4493TemplateInstantiator Instantiator(*
this, TemplateArgs,
4496 returnInstantiator.TransformStmt(S);
4504TemplateInstantiator Instantiator(*
this, TemplateArgs,
Loc, Entity);
4505 returnInstantiator.TransformTemplateArgument(Input, Output);
4512TemplateInstantiator Instantiator(*
this, TemplateArgs,
SourceLocation(),
4514 returnInstantiator.TransformTemplateArguments(Args.begin(), Args.end(), Out);
4522TemplateInstantiator Instantiator(*
this, TemplateArgs,
4525 returnInstantiator.TransformExpr(
E);
4541TemplateInstantiator Instantiator(*
this, TemplateArgs,
SourceLocation(),
4543Instantiator.setEvaluateConstraints(
false);
4544 returnInstantiator.TransformExpr(
E);
4549 boolCXXDirectInit) {
4550TemplateInstantiator Instantiator(*
this, TemplateArgs,
SourceLocation(),
4552 returnInstantiator.TransformInitializer(
Init, CXXDirectInit);
4561TemplateInstantiator Instantiator(*
this, TemplateArgs,
4564 returnInstantiator.TransformExprs(Exprs.data(), Exprs.size(),
4574TemplateInstantiator Instantiator(*
this, TemplateArgs, NNS.
getBeginLoc(),
4576 returnInstantiator.TransformNestedNameSpecifierLoc(NNS);
4582TemplateInstantiator Instantiator(*
this, TemplateArgs, NameInfo.
getLoc(),
4584 returnInstantiator.TransformDeclarationNameInfo(NameInfo);
4591TemplateInstantiator Instantiator(*
this, TemplateArgs,
Loc,
4594SS.
Adopt(QualifierLoc);
4595 returnInstantiator.TransformTemplateName(SS, Name,
Loc);
4603 if(
const ParmVarDecl*PV = dyn_cast<ParmVarDecl>(
D)) {
4604 if(
const FunctionDecl*FD = dyn_cast<FunctionDecl>(PV->getDeclContext())) {
4605 unsignedi = PV->getFunctionScopeIndex();
4608 if(i < FD->getNumParams() && FD->getParamDecl(i) == PV)
4616llvm::PointerUnion<Decl *, LocalInstantiationScope::DeclArgumentPack *> *
4620Current = Current->Outer) {
4623 const Decl*CheckD =
D;
4625LocalDeclsMap::iterator
Found= Current->LocalDecls.find(CheckD);
4626 if(
Found!= Current->LocalDecls.end())
4627 return&
Found->second;
4631 if(
const TagDecl*Tag = dyn_cast<TagDecl>(CheckD))
4632CheckD = Tag->getPreviousDecl();
4638 if(!Current->CombineWithOuterScope)
4644 if(isa<NonTypeTemplateParmDecl>(
D) || isa<TemplateTypeParmDecl>(
D) ||
4645isa<TemplateTemplateParmDecl>(
D))
4650 if(RD->isLocalClass())
4655 if(isa<EnumDecl>(
D))
4660 if(isa<TypedefNameDecl>(
D) &&
4667assert(isa<LabelDecl>(
D) &&
"declaration not instantiated in this scope");
4673llvm::PointerUnion<Decl *, DeclArgumentPack *> &Stored = LocalDecls[
D];
4674 if(Stored.isNull()) {
4678 while(Current->CombineWithOuterScope && Current->Outer) {
4679Current = Current->Outer;
4680assert(!Current->LocalDecls.contains(
D) &&
4681 "Instantiated local in inner and outer scopes");
4685}
else if(
DeclArgumentPack*Pack = dyn_cast<DeclArgumentPack *>(Stored)) {
4686Pack->push_back(cast<VarDecl>(Inst));
4688assert(cast<Decl *>(Stored) == Inst &&
"Already instantiated this local");
4696Pack->push_back(Inst);
4703Current && Current->CombineWithOuterScope; Current = Current->Outer)
4704assert(!Current->LocalDecls.contains(
D) &&
4705 "Creating local pack after instantiation of local");
4709llvm::PointerUnion<Decl *, DeclArgumentPack *> &Stored = LocalDecls[
D];
4712ArgumentPacks.push_back(Pack);
4717 if(llvm::is_contained(*Pack,
D))
4724 unsignedNumExplicitArgs) {
4725assert((!PartiallySubstitutedPack || PartiallySubstitutedPack == Pack) &&
4726 "Already have a partially-substituted pack");
4727assert((!PartiallySubstitutedPack
4728|| NumArgsInPartiallySubstitutedPack == NumExplicitArgs) &&
4729 "Wrong number of arguments in partially-substituted pack");
4730PartiallySubstitutedPack = Pack;
4731ArgsInPartiallySubstitutedPack = ExplicitArgs;
4732NumArgsInPartiallySubstitutedPack = NumExplicitArgs;
4737 unsigned*NumExplicitArgs)
const{
4739*ExplicitArgs =
nullptr;
4740 if(NumExplicitArgs)
4741*NumExplicitArgs = 0;
4744Current = Current->Outer) {
4745 if(Current->PartiallySubstitutedPack) {
4747*ExplicitArgs = Current->ArgsInPartiallySubstitutedPack;
4748 if(NumExplicitArgs)
4749*NumExplicitArgs = Current->NumArgsInPartiallySubstitutedPack;
4751 returnCurrent->PartiallySubstitutedPack;
4754 if(!Current->CombineWithOuterScope)
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
This file provides some common utility functions for processing Lambda related AST Constructs.
Defines the C++ template declaration subclasses.
Defines Expressions and AST nodes for C++2a concepts.
static void print(llvm::raw_ostream &OS, const T &V, ASTContext &ASTCtx, QualType Ty)
Defines the clang::LangOptions interface.
llvm::MachO::Record Record
MatchFinder::MatchResult MatchResult
static const Decl * getCanonicalParmVarDecl(const Decl *D)
static ActionResult< CXXRecordDecl * > getPatternForClassTemplateSpecialization(Sema &S, SourceLocation PointOfInstantiation, ClassTemplateSpecializationDecl *ClassTemplateSpec, TemplateSpecializationKind TSK, bool PrimaryHasMatchedPackOnParmToNonPackOnArg)
Get the instantiation pattern to use to instantiate the definition of a given ClassTemplateSpecializa...
static bool NeedsInstantiationAsFunctionType(TypeSourceInfo *T)
static concepts::Requirement::SubstitutionDiagnostic * createSubstDiag(Sema &S, TemplateDeductionInfo &Info, Sema::EntityPrinter Printer)
static std::string convertCallArgsToString(Sema &S, llvm::ArrayRef< const Expr * > Args)
static TemplateArgument getPackSubstitutedTemplateArgument(Sema &S, TemplateArgument Arg)
Defines the clang::TypeLoc interface and its subclasses.
C Language Family Type Representation.
virtual void HandleTagDeclDefinition(TagDecl *D)
HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g.
virtual bool HandleTopLevelDecl(DeclGroupRef D)
HandleTopLevelDecl - Handle the specified top-level declaration.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
TranslationUnitDecl * getTranslationUnitDecl() const
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl.
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex, SubstTemplateTypeParmTypeFlag Flag=SubstTemplateTypeParmTypeFlag::None) const
Retrieve a substitution-result type.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
const clang::PrintingPolicy & getPrintingPolicy() const
const TargetInfo & getTargetInfo() const
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Attr - This represents one attribute.
An attributed type is a type to which a type attribute has been applied.
A binding in a decomposition declaration.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a base class of a C++ class.
A default argument (C++ [dcl.fct.default]).
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
const FunctionDecl * isLocalClass() const
If the class is a local class [class.local], returns the enclosing function declaration.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
bool isLambda() const
Determine whether this class describes a lambda function object.
CXXRecordDecl * getDefinition() const
unsigned getNumBases() const
Retrieves the number of base classes of this class.
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization,...
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
CXXRecordDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the kind of specialization or template instantiation this is.
Represents a C++ nested-name-specifier or a global scope specifier.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
Declaration of a class template.
ClassTemplateDecl * getMostRecentDecl()
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
llvm::FoldingSetVector< ClassTemplatePartialSpecializationDecl > & getPartialSpecializations() const
Retrieve the set of partial specializations of this class template.
ClassTemplateDecl * getInstantiatedFromMemberTemplate() const
Represents a class template specialization, which refers to a class template with a given set of temp...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
bool isClassScopeExplicitSpecialization() const
Is this an explicit specialization at class scope (within the class that owns the primary template)?...
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
void setInstantiationOf(ClassTemplatePartialSpecializationDecl *PartialSpec, const TemplateArgumentList *TemplateArgs)
Note that this class template specialization is actually an instantiation of the given class template...
NamedDecl * getFoundDecl() const
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
bool HasSubstitutionFailure()
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
The results of name lookup within a DeclContext.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool isFileContext() const
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
RecordDecl * getOuterLexicalRecordContext()
Retrieve the outermost lexically enclosing record context.
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
A reference to a declared variable, function, enum, etc.
Decl - This represents one declaration (or definition), e.g.
TemplateDecl * getDescribedTemplate() const
If this is a declaration that describes some template, this method returns that template declaration.
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
bool isParameterPack() const
Whether this declaration is a parameter pack.
void setInvalidDecl(bool Invalid=true)
setInvalidDecl - Indicates the Decl had a semantic error.
bool isFileContextDecl() const
static Decl * castFromDeclContext(const DeclContext *)
unsigned getTemplateDepth() const
Determine the number of levels of template parameter surrounding this declaration.
DeclContext * getNonTransparentDeclContext()
Return the non transparent context.
bool isInvalidDecl() const
SourceLocation getLocation() const
void setLocation(SourceLocation L)
bool isDefinedOutsideFunctionOrMethod() const
isDefinedOutsideFunctionOrMethod - This predicate returns true if this scoped decl is defined outside...
DeclContext * getDeclContext()
void setDeclContext(DeclContext *DC)
setDeclContext - Set both the semantic and lexical DeclContext to DC.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
void setVisibleDespiteOwningModule()
Set that this declaration is globally visible, even if it came from a module that is not visible.
The name of a declaration.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
SourceLocation getOuterLocStart() const
Return start of source range taking into account any outer template declarations.
SourceLocation getBeginLoc() const LLVM_READONLY
TypeSourceInfo * getTypeSourceInfo() const
Information about one declarator, including the parsed type information and the identifier.
Represents an extended vector type where either the type or size is dependent.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
bool hasFatalErrorOccurred() const
unsigned getTemplateBacktraceLimit() const
Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic.
Recursive AST visitor that supports extension via dynamic dispatch.
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
RAII object that enters a new expression evaluation context.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization,...
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For an enumeration member that was instantiated from a member enumeration of a templated class,...
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
EnumDecl * getDefinition() const
This represents one expression.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx, SmallVectorImpl< PartialDiagnosticAt > *Diag=nullptr) const
EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded integer.
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
bool hasPlaceholderType() const
Returns whether this expression has a placeholder type.
ExprDependence getDependence() const
Represents a member of a struct/union/class.
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set.
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
InClassInitStyle getInClassInitStyle() const
Get the kind of (C++11) default member initializer that this field has.
const RecordDecl * getParent() const
Returns the parent of this field declaration, which is the struct in which this field is defined.
static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code)
Create a code modification hint that replaces the given source range with the given code string.
Represents a function declaration or definition.
ArrayRef< ParmVarDecl * > parameters() const
FunctionDecl * getTemplateInstantiationPattern(bool ForDefinition=true) const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
FunctionTemplateDecl * getPrimaryTemplate() const
Retrieve the primary template that this function template specialization either specializes or was in...
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
VarDecl *const * iterator
Iterators over the parameters which the parameter pack expanded into.
static FunctionParmPackExpr * Create(const ASTContext &Context, QualType T, VarDecl *ParamPack, SourceLocation NameLoc, ArrayRef< VarDecl * > Params)
Represents a prototype with parameter type info, e.g.
ExtProtoInfo getExtProtoInfo() const
Declaration of a template function.
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
ArrayRef< ParmVarDecl * > getParams() const
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
FunctionType - C99 6.7.5.3 - Function Declarators.
QualType getReturnType() const
One of these records is kept for each identifier that is lexed.
ArrayRef< TemplateArgument > getTemplateArguments() const
const TypeClass * getTypePtr() const
Describes the kind of initialization being performed, along with location information for tokens rela...
static InitializationKind CreateCopy(SourceLocation InitLoc, SourceLocation EqualLoc, bool AllowExplicitConvs=false)
Create a copy initialization.
Describes the sequence of initializations required to initialize a given object or reference with a s...
Describes an entity that is being initialized.
static InitializedEntity InitializeParameter(ASTContext &Context, ParmVarDecl *Parm)
Create the initialization entity for a parameter.
Wrapper for source info for injected class names of class templates.
The injected class name of a C++ class template or class template partial specialization.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
A stack-allocated class that identifies which local variable declaration instantiations are present i...
void SetPartiallySubstitutedPack(NamedDecl *Pack, const TemplateArgument *ExplicitArgs, unsigned NumExplicitArgs)
Note that the given parameter pack has been partially substituted via explicit specification of templ...
NamedDecl * getPartiallySubstitutedPack(const TemplateArgument **ExplicitArgs=nullptr, unsigned *NumExplicitArgs=nullptr) const
Retrieve the partially-substitued template parameter pack.
bool isLocalPackExpansion(const Decl *D)
Determine whether D is a pack expansion created in this scope.
static void deleteScopes(LocalInstantiationScope *Scope, LocalInstantiationScope *Outermost)
deletes the given scope, and all outer scopes, down to the given outermost scope.
void InstantiatedLocal(const Decl *D, Decl *Inst)
void InstantiatedLocalPackArg(const Decl *D, VarDecl *Inst)
void MakeInstantiatedLocalArgPack(const Decl *D)
llvm::PointerUnion< Decl *, DeclArgumentPack * > * findInstantiationOf(const Decl *D)
Find the instantiation of the declaration D within the current instantiation scope.
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
A pointer to member type per C++ 8.3.3 - Pointers to members.
Provides information a specialization of a member of a class template, which may be a member function...
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the template specialization kind.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
void setPointOfInstantiation(SourceLocation POI)
Set the first point of instantiation.
Describes a module or submodule.
Data structure that captures multiple levels of template argument lists for use in template instantia...
bool hasTemplateArgument(unsigned Depth, unsigned Index) const
Determine whether there is a non-NULL template argument at the given depth and index.
const ArgList & getInnermost() const
Retrieve the innermost template argument list.
std::pair< Decl *, bool > getAssociatedDecl(unsigned Depth) const
A template-like entity which owns the whole pattern being substituted.
unsigned getNumLevels() const
Determine the number of levels in this template argument list.
unsigned getNumSubstitutedLevels() const
Determine the number of substituted levels in this template argument list.
unsigned getNewDepth(unsigned OldDepth) const
Determine how many of the OldDepth outermost template parameter lists would be removed by substitutin...
void setArgument(unsigned Depth, unsigned Index, TemplateArgument Arg)
Clear out a specific template argument.
bool isRewrite() const
Determine whether we are rewriting template parameters rather than substituting for them.
This represents a decl that may have a name.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
virtual void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const
Appends a human-readable name for this declaration into the given stream.
virtual void printName(raw_ostream &OS, const PrintingPolicy &Policy) const
Pretty-print the unqualified name of this declaration.
A C++ nested-name-specifier augmented with source location information.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
bool isInstantiationDependent() const
Whether this nested name specifier involves a template parameter.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
Represents a pack expansion of types.
Sugar for parentheses used when specifying types.
Represents a parameter to a function.
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
void setDefaultArg(Expr *defarg)
SourceLocation getExplicitObjectParamThisLoc() const
void setUnparsedDefaultArg()
Specify that this parameter has an unparsed default argument.
bool hasUnparsedDefaultArg() const
Determines whether this parameter has a default argument that has not yet been parsed.
void setUninstantiatedDefaultArg(Expr *arg)
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
bool hasUninstantiatedDefaultArg() const
bool hasInheritedDefaultArg() const
void setExplicitObjectParameterLoc(SourceLocation Loc)
Expr * getUninstantiatedDefaultArg()
unsigned getFunctionScopeDepth() const
void setHasInheritedDefaultArg(bool I=true)
PointerType - C99 6.7.5.1 - Pointer Declarators.
[C99 6.4.2.2] - A predefined identifier such as func.
PrettyDeclStackTraceEntry - If a crash occurs in the parser while parsing something related to a decl...
A (possibly-)qualified type.
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type.
void addConst()
Add the const type qualifier to this QualType.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
The collection of all-type qualifiers we support.
void removeObjCLifetime()
Represents a struct/union/class.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
Base for LValueReferenceType and RValueReferenceType.
Represents the body of a requires-expression.
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
SourceLocation getLParenLoc() const
SourceLocation getRParenLoc() const
Scope - A scope is a transient data structure that is used while parsing the program.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
RAII object used to change the argument pack substitution index within a Sema object.
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
For a defaulted function, the kind of defaulted function that it is.
DefaultedComparisonKind asComparison() const
bool isSpecialMember() const
bool isComparison() const
CXXSpecialMemberKind asSpecialMember() const
A helper class for building up ExtParameterInfos.
RAII class used to determine whether SFINAE has trapped any errors that occur during template argumen...
Sema - This implements semantic analysis and AST building for C.
llvm::DenseSet< Module * > LookupModulesCache
Cache of additional modules that should be used for name lookup within the current template instantia...
bool SubstTypeConstraint(TemplateTypeParmDecl *Inst, const TypeConstraint *TC, const MultiLevelTemplateArgumentList &TemplateArgs, bool EvaluateConstraint)
SmallVector< CodeSynthesisContext, 16 > CodeSynthesisContexts
List of active code synthesis contexts.
LocalInstantiationScope * CurrentInstantiationScope
The current instantiation scope used to store local variables.
TemplateArgumentLoc getTrivialTemplateArgumentLoc(const TemplateArgument &Arg, QualType NTTPType, SourceLocation Loc, NamedDecl *TemplateParam=nullptr)
Allocate a TemplateArgumentLoc where all locations have been initialized to the given location.
DefaultedFunctionKind getDefaultedFunctionKind(const FunctionDecl *FD)
Determine the kind of defaulting that would be done for a given function.
bool CheckParameterPacksForExpansion(SourceLocation EllipsisLoc, SourceRange PatternRange, ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs, bool &ShouldExpand, bool &RetainExpansion, std::optional< unsigned > &NumExpansions)
Determine whether we could expand a pack expansion with the given set of parameter packs into separat...
TemplateName SubstTemplateName(NestedNameSpecifierLoc QualifierLoc, TemplateName Name, SourceLocation Loc, const MultiLevelTemplateArgumentList &TemplateArgs)
ParmVarDecl * SubstParmVarDecl(ParmVarDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, int indexAdjustment, std::optional< unsigned > NumExpansions, bool ExpectParameterPack, bool EvaluateConstraints=true)
void ActOnFinishCXXNonNestedClass()
NamedDecl * FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, bool FindingInstantiatedContext=false)
Find the instantiation of the given declaration within the current instantiation.
void ActOnFinishDelayedMemberInitializers(Decl *Record)
bool DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain=true)
Determine whether we would be unable to instantiate this template (because it either has no definitio...
void InstantiateClassTemplateSpecializationMembers(SourceLocation PointOfInstantiation, ClassTemplateSpecializationDecl *ClassTemplateSpec, TemplateSpecializationKind TSK)
Instantiate the definitions of all of the members of the given class template specialization,...
ClassTemplatePartialSpecializationDecl * getMoreSpecializedPartialSpecialization(ClassTemplatePartialSpecializationDecl *PS1, ClassTemplatePartialSpecializationDecl *PS2, SourceLocation Loc)
Returns the more specialized class template partial specialization according to the rules of partial ...
llvm::DenseSet< std::pair< Decl *, unsigned > > InstantiatingSpecializations
Specializations whose definitions are currently being instantiated.
void deduceOpenCLAddressSpace(ValueDecl *decl)
ExprResult SubstInitializer(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs, bool CXXDirectInit)
llvm::function_ref< void(llvm::raw_ostream &)> EntityPrinter
void SubstExceptionSpec(FunctionDecl *New, const FunctionProtoType *Proto, const MultiLevelTemplateArgumentList &Args)
concepts::Requirement::SubstitutionDiagnostic * createSubstDiagAt(SourceLocation Location, EntityPrinter Printer)
create a Requirement::SubstitutionDiagnostic with only a SubstitutedEntity and DiagLoc using ASTConte...
@ CTAK_Specified
The template argument was specified in the code or was instantiated with some deduced template argume...
bool SubstExprs(ArrayRef< Expr * > Exprs, bool IsCall, const MultiLevelTemplateArgumentList &TemplateArgs, SmallVectorImpl< Expr * > &Outputs)
Substitute the given template arguments into a list of expressions, expanding pack expansions if requ...
StmtResult SubstStmt(Stmt *S, const MultiLevelTemplateArgumentList &TemplateArgs)
bool InNonInstantiationSFINAEContext
Whether we are in a SFINAE context that is not associated with template instantiation.
ExprResult SubstExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
DiagnosticsEngine & getDiagnostics() const
TypeSourceInfo * CheckPackExpansion(TypeSourceInfo *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions)
Construct a pack expansion type from the pattern of the pack expansion.
ExprResult BuildExpressionFromNonTypeTemplateArgument(const TemplateArgument &Arg, SourceLocation Loc)
ExprResult SubstConstraintExprWithoutSatisfaction(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
ASTContext & getASTContext() const
TypeSourceInfo * SubstType(TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, bool AllowDeducedTST=false)
Perform substitution on the type T with a given set of template arguments.
void InstantiateVariableDefinition(SourceLocation PointOfInstantiation, VarDecl *Var, bool Recursive=false, bool DefinitionRequired=false, bool AtEndOfTU=false)
Instantiate the definition of the given variable from its template.
void ActOnStartCXXInClassMemberInitializer()
Enter a new C++ default initializer scope.
PrintingPolicy getPrintingPolicy() const
Retrieve a suitable printing policy for diagnostics.
bool SubstTemplateArguments(ArrayRef< TemplateArgumentLoc > Args, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentListInfo &Outputs)
bool isAcceptableTagRedeclaration(const TagDecl *Previous, TagTypeKind NewTag, bool isDefinition, SourceLocation NewTagLoc, const IdentifierInfo *Name)
Determine whether a tag with a given kind is acceptable as a redeclaration of the given tag declarati...
bool CheckTemplateArgument(NamedDecl *Param, TemplateArgumentLoc &Arg, NamedDecl *Template, SourceLocation TemplateLoc, SourceLocation RAngleLoc, unsigned ArgumentPackIndex, CheckTemplateArgumentInfo &CTAI, CheckTemplateArgumentKind CTAK)
Check that the given template argument corresponds to the given template parameter.
void InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs, const Decl *Pattern, Decl *Inst, LateInstantiatedAttrVec *LateAttrs=nullptr, LocalInstantiationScope *OuterMostScope=nullptr)
const LangOptions & getLangOpts() const
bool AttachTypeConstraint(NestedNameSpecifierLoc NS, DeclarationNameInfo NameInfo, ConceptDecl *NamedConcept, NamedDecl *FoundDecl, const TemplateArgumentListInfo *TemplateArgs, TemplateTypeParmDecl *ConstrainedParameter, QualType ConstrainedType, SourceLocation EllipsisLoc)
Attach a type-constraint to a template parameter.
void collectUnexpandedParameterPacks(TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
Collect the set of unexpanded parameter packs within the given template argument.
bool CheckConstraintSatisfaction(const NamedDecl *Template, ArrayRef< const Expr * > ConstraintExprs, const MultiLevelTemplateArgumentList &TemplateArgLists, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction)
Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given...
void InstantiateClassMembers(SourceLocation PointOfInstantiation, CXXRecordDecl *Instantiation, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK)
Instantiates the definitions of all of the member of the given class, which is an instantiation of a ...
void MarkVirtualMembersReferenced(SourceLocation Loc, const CXXRecordDecl *RD, bool ConstexprOnly=false)
MarkVirtualMembersReferenced - Will mark all members of the given CXXRecordDecl referenced.
DeclarationNameInfo SubstDeclarationNameInfo(const DeclarationNameInfo &NameInfo, const MultiLevelTemplateArgumentList &TemplateArgs)
Do template substitution on declaration name info.
void MarkVTableUsed(SourceLocation Loc, CXXRecordDecl *Class, bool DefinitionRequired=false)
Note that the vtable for the given class was used at the given location.
std::vector< std::unique_ptr< TemplateInstantiationCallback > > TemplateInstCallbacks
The template instantiation callbacks to trace or track instantiations (objects can be chained).
void PrintInstantiationStack()
Prints the current instantiation stack through a series of notes.
void popCodeSynthesisContext()
bool InstantiateClassTemplateSpecialization(SourceLocation PointOfInstantiation, ClassTemplateSpecializationDecl *ClassTemplateSpec, TemplateSpecializationKind TSK, bool Complain=true, bool PrimaryHasMatchedPackOnParmToNonPackOnArg=false)
bool usesPartialOrExplicitSpecialization(SourceLocation Loc, ClassTemplateSpecializationDecl *ClassTemplateSpec)
void pushCodeSynthesisContext(CodeSynthesisContext Ctx)
bool CheckLoopHintExpr(Expr *E, SourceLocation Loc, bool AllowZero)
std::optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
CXXBaseSpecifier * CheckBaseSpecifier(CXXRecordDecl *Class, SourceRange SpecifierRange, bool Virtual, AccessSpecifier Access, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc)
Check the validity of a C++ base class specifier.
UnparsedDefaultArgInstantiationsMap UnparsedDefaultArgInstantiations
A mapping from parameters with unparsed default arguments to the set of instantiations of each parame...
bool SubstParmTypes(SourceLocation Loc, ArrayRef< ParmVarDecl * > Params, const FunctionProtoType::ExtParameterInfo *ExtParamInfos, const MultiLevelTemplateArgumentList &TemplateArgs, SmallVectorImpl< QualType > &ParamTypes, SmallVectorImpl< ParmVarDecl * > *OutParams, ExtParameterInfoBuilder &ParamInfos)
Substitute the given template arguments into the given set of parameters, producing the set of parame...
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(const NamedDecl *D, const DeclContext *DC=nullptr, bool Final=false, std::optional< ArrayRef< TemplateArgument > > Innermost=std::nullopt, bool RelativeToPrimary=false, const FunctionDecl *Pattern=nullptr, bool ForConstraintInstantiation=false, bool SkipForSpecialization=false, bool ForDefaultArgumentSubstitution=false)
Retrieve the template argument list(s) that should be used to instantiate the definition of the given...
std::deque< PendingImplicitInstantiation > PendingLocalImplicitInstantiations
The queue of implicit template instantiations that are required and must be performed within the curr...
ParmVarDecl * CheckParameter(DeclContext *DC, SourceLocation StartLoc, SourceLocation NameLoc, const IdentifierInfo *Name, QualType T, TypeSourceInfo *TSInfo, StorageClass SC)
bool CheckFunctionConstraints(const FunctionDecl *FD, ConstraintSatisfaction &Satisfaction, SourceLocation UsageLoc=SourceLocation(), bool ForOverloadResolution=false)
Check whether the given function decl's trailing requires clause is satisfied, if any.
bool CheckSpecializationInstantiationRedecl(SourceLocation NewLoc, TemplateSpecializationKind ActOnExplicitInstantiationNewTSK, NamedDecl *PrevDecl, TemplateSpecializationKind PrevTSK, SourceLocation PrevPtOfInstantiation, bool &SuppressNew)
Diagnose cases where we have an explicit template specialization before/after an explicit template in...
ExprResult CheckPlaceholderExpr(Expr *E)
Check for operands with placeholder types and complain if found.
unsigned NonInstantiationEntries
The number of CodeSynthesisContexts that are not template instantiations and, therefore,...
bool CheckNoInlineAttr(const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A)
void ActOnFinishCXXInClassMemberInitializer(Decl *VarDecl, SourceLocation EqualLoc, ExprResult Init)
This is invoked after parsing an in-class initializer for a non-static C++ class member,...
bool CheckAlwaysInlineAttr(const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A)
ExprResult BuildCXXDefaultArgExpr(SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param, Expr *Init=nullptr)
BuildCXXDefaultArgExpr - Creates a CXXDefaultArgExpr, instantiating the default expr if needed.
bool InstantiateInClassInitializer(SourceLocation PointOfInstantiation, FieldDecl *Instantiation, FieldDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs)
Instantiate the definition of a field from the given pattern.
bool InstantiateClass(SourceLocation PointOfInstantiation, CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK, bool Complain=true)
Instantiate the definition of a class from a given pattern.
bool SubstTemplateArgument(const TemplateArgumentLoc &Input, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentLoc &Output, SourceLocation Loc={}, const DeclarationName &Entity={})
void InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, FunctionDecl *Function, bool Recursive=false, bool DefinitionRequired=false, bool AtEndOfTU=false)
Instantiate the definition of the given function from its template.
bool SubstDefaultArgument(SourceLocation Loc, ParmVarDecl *Param, const MultiLevelTemplateArgumentList &TemplateArgs, bool ForCallExpr=false)
Substitute the given template arguments into the default argument.
ExprResult SubstConstraintExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
bool hasUncompilableErrorOccurred() const
Whether uncompilable error has occurred.
@ ConstantEvaluated
The current context is "potentially evaluated" in C++11 terms, but the expression is evaluated at com...
@ PotentiallyEvaluated
The current expression is potentially evaluated at run time, which means that code may be generated t...
unsigned LastEmittedCodeSynthesisContextDepth
The depth of the context stack at the point when the most recent error or warning was produced.
NestedNameSpecifierLoc SubstNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS, const MultiLevelTemplateArgumentList &TemplateArgs)
void ActOnFields(Scope *S, SourceLocation RecLoc, Decl *TagDecl, ArrayRef< Decl * > Fields, SourceLocation LBrac, SourceLocation RBrac, const ParsedAttributesView &AttrList)
bool RebuildingImmediateInvocation
Whether the AST is currently being rebuilt to correct immediate invocations.
void CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record)
Perform semantic checks on a class definition that has been completing, introducing implicitly-declar...
SmallVector< ExpressionEvaluationContextRecord, 8 > ExprEvalContexts
A stack of expression evaluation contexts.
SourceManager & SourceMgr
DiagnosticsEngine & Diags
bool AttachBaseSpecifiers(CXXRecordDecl *Class, MutableArrayRef< CXXBaseSpecifier * > Bases)
Performs the actual work of attaching the given base class specifiers to a C++ class.
SmallVector< Module *, 16 > CodeSynthesisContextLookupModules
Extra modules inspected when performing a lookup during a template instantiation.
ExprResult ConvertParamDefaultArgument(ParmVarDecl *Param, Expr *DefaultArg, SourceLocation EqualLoc)
TemplateDeductionResult DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &Info)
void runWithSufficientStackSpace(SourceLocation Loc, llvm::function_ref< void()> Fn)
Run some code with "sufficient" stack space.
ExprResult CreateRecoveryExpr(SourceLocation Begin, SourceLocation End, ArrayRef< Expr * > SubExprs, QualType T=QualType())
Attempts to produce a RecoveryExpr after some AST node cannot be created.
bool InstantiateEnum(SourceLocation PointOfInstantiation, EnumDecl *Instantiation, EnumDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK)
Instantiate the definition of an enum from a given pattern.
void UpdateExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI)
std::string getTemplateArgumentBindingsText(const TemplateParameterList *Params, const TemplateArgumentList &Args)
Produces a formatted string that describes the binding of template parameters to template arguments.
ExprResult BuildExpressionFromDeclTemplateArgument(const TemplateArgument &Arg, QualType ParamType, SourceLocation Loc, NamedDecl *TemplateParam=nullptr)
Given a non-type template argument that refers to a declaration and the type of its corresponding non...
bool SubstBaseSpecifiers(CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs)
Perform substitution on the base class specifiers of the given class template specialization.
void PerformDependentDiagnostics(const DeclContext *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs)
ASTMutationListener * getASTMutationListener() const
ExprResult ActOnFinishFullExpr(Expr *Expr, bool DiscardedValue)
TypeSourceInfo * SubstFunctionDeclType(TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, CXXRecordDecl *ThisContext, Qualifiers ThisTypeQuals, bool EvaluateConstraints=true)
A form of SubstType intended specifically for instantiating the type of a FunctionDecl.
Encodes a location in the source.
unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
StringRef getFilename(SourceLocation SpellingLoc) const
Return the filename of the file containing a SourceLocation.
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID.
A trivial tuple used to represent a source range.
void warnOnStackNearlyExhausted(SourceLocation Loc)
Check to see if we're low on stack space and produce a warning if we're low on stack space (Currently...
Represents a C++11 static_assert declaration.
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
A structure for storing an already-substituted template template parameter pack.
Wrapper for substituted template type parameters.
Represents the result of substituting a set of types for a template type parameter pack.
Wrapper for substituted template type parameters.
Represents the result of substituting a type for a template type parameter.
Represents the declaration of a struct/union/class/enum.
void setTagKind(TagKind TK)
SourceRange getBraceRange() const
SourceLocation getInnerLocStart() const
Return SourceLocation representing start of source range ignoring outer template declarations.
StringRef getKindName() const
void startDefinition()
Starts the definition of this tag declaration.
TagKind getTagKind() const
void setBraceRange(SourceRange R)
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
A convenient class for passing around template argument information.
void setLAngleLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
A template argument list.
ArrayRef< TemplateArgument > asArray() const
Produce this as an array ref.
Location wrapper for a TemplateArgument.
const TemplateArgument & getArgument() const
Represents a template argument.
ArrayRef< TemplateArgument > getPackAsArray() const
Return the array of arguments in this template argument pack.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
bool isDependent() const
Whether this template argument is dependent on a template parameter such that its result can change f...
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
QualType getAsType() const
Retrieve the type for a type template argument.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
TemplateArgument getPackExpansionPattern() const
When the template argument is a pack expansion, returns the pattern of the pack expansion.
bool isNull() const
Determine whether this template argument has no value.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
@ Template
The template argument is a template name that was provided for a template template parameter.
@ Pack
The template argument is actually a parameter pack.
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
@ Type
The template argument is a type.
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
ArgKind getKind() const
Return the kind of stored template argument.
bool isPackExpansion() const
Determine whether this template argument is a pack expansion.
void enableLateAttributeInstantiation(Sema::LateInstantiatedAttrVec *LA)
void disableLateAttributeInstantiation()
delayed_var_partial_spec_iterator delayed_var_partial_spec_end()
delayed_partial_spec_iterator delayed_partial_spec_begin()
Return an iterator to the beginning of the set of "delayed" partial specializations,...
void setEvaluateConstraints(bool B)
SmallVectorImpl< std::pair< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > >::iterator delayed_var_partial_spec_iterator
LocalInstantiationScope * getStartingScope() const
VarTemplatePartialSpecializationDecl * InstantiateVarTemplatePartialSpecialization(VarTemplateDecl *VarTemplate, VarTemplatePartialSpecializationDecl *PartialSpec)
Instantiate the declaration of a variable template partial specialization.
SmallVectorImpl< std::pair< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > >::iterator delayed_partial_spec_iterator
void InstantiateEnumDefinition(EnumDecl *Enum, EnumDecl *Pattern)
delayed_partial_spec_iterator delayed_partial_spec_end()
Return an iterator to the end of the set of "delayed" partial specializations, which must be passed t...
delayed_var_partial_spec_iterator delayed_var_partial_spec_begin()
ClassTemplatePartialSpecializationDecl * InstantiateClassTemplatePartialSpecialization(ClassTemplateDecl *ClassTemplate, ClassTemplatePartialSpecializationDecl *PartialSpec)
Instantiate the declaration of a class template partial specialization.
The base class of all kinds of template declarations (e.g., class, function, etc.).
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a C++ template name within the type system.
TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const
Retrieve the underlying template declaration that this template name refers to, if known.
bool isNull() const
Determine whether this template name is NULL.
Stores a list of template parameters for a TemplateDecl and its derived classes.
NamedDecl * getParam(unsigned Idx)
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getTemplateLoc() const
TemplateSpecCandidateSet - A set of generalized overload candidates, used in template specializations...
SourceLocation getLocation() const
TemplateSpecCandidate & addCandidate()
Add a new candidate with NumConversions conversion sequence slots to the overload set.
Represents a type template specialization; the template must be a class template, a type alias templa...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
unsigned getDepth() const
Get the nesting depth of the template parameter.
Declaration of a template type parameter.
bool isParameterPack() const
Returns whether this is a parameter pack.
void setTypeConstraint(ConceptReference *CR, Expr *ImmediatelyDeclaredConstraint)
Wrapper for template type parameters.
bool isParameterPack() const
unsigned getIndex() const
unsigned getDepth() const
A semantic tree transformation that allows one to transform one abstract syntax tree into another.
Declaration of an alias template.
TypeAliasDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
ConceptDecl * getNamedConcept() const
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
const DeclarationNameInfo & getConceptNameInfo() const
ConceptReference * getConceptReference() const
void setLocStart(SourceLocation L)
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
void pushFullCopy(TypeLoc L)
Pushes a copy of the given TypeLoc onto this builder.
void reserve(size_t Requested)
Ensures that this buffer has at least as much capacity as described.
TypeSourceInfo * getTypeSourceInfo(ASTContext &Context, QualType T)
Creates a TypeSourceInfo for the given type.
void pushTrivial(ASTContext &Context, QualType T, SourceLocation Loc)
Pushes 'T' with all locations pointing to 'Loc'.
Base wrapper for a particular "section" of type source info.
QualType getType() const
Get the type for which this source info wrapper provides information.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
TypeLoc IgnoreParens() const
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
unsigned getFullDataSize() const
Returns the size of the type source info data block.
SourceLocation getEndLoc() const
Get the end source location.
SourceLocation getBeginLoc() const
Get the begin source location.
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
QualType getType() const
Return the type wrapped by this type source info.
SourceLocation getNameLoc() const
void setNameLoc(SourceLocation Loc)
static TagTypeKind getTagTypeKindForKeyword(ElaboratedTypeKeyword Keyword)
Converts an elaborated type keyword into a TagTypeKind.
The base class of the type hierarchy.
bool isReferenceType() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
const T * getAs() const
Member-template getAs<specific type>'.
bool isRecordType() const
QualType getUnderlyingType() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Represents a variable declaration or definition.
bool isStaticDataMember() const
Determines whether this is a static data member.
VarDecl * getDefinition(ASTContext &)
Get the real (not just tentative) definition for this declaration.
VarDecl * getInstantiatedFromStaticDataMember() const
If this variable is an instantiated static data member of a class template specialization,...
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For a static data member that was instantiated from a static data member of a class template,...
StorageClass getStorageClass() const
Returns the storage class as written in the source.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization,...
Declaration of a variable template.
Represents a variable template specialization, which refers to a variable template with a given set o...
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
bool isClassScopeExplicitSpecialization() const
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
Represents a GCC generic vector type.
A requires-expression requirement which queries the validity and properties of an expression ('simple...
SubstitutionDiagnostic * getExprSubstitutionDiagnostic() const
bool isExprSubstitutionFailure() const
const ReturnTypeRequirement & getReturnTypeRequirement() const
SourceLocation getNoexceptLoc() const
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
const ASTConstraintSatisfaction & getConstraintSatisfaction() const
bool hasInvalidConstraint() const
Expr * getConstraintExpr() const
StringRef getInvalidConstraintEntity()
A static requirement that can be used in a requires-expression to check properties of types and expre...
A requires-expression requirement which queries the existence of a type name or type template special...
bool isSubstitutionFailure() const
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
TypeSourceInfo * getType() const
CXXMethodDecl * CallOperator
The lambda's compiler-generated operator().
Provides information about an attempted template argument deduction, whose success or failure was des...
TemplateArgumentList * takeCanonical()
SourceLocation getLocation() const
Returns the location at which template argument is occurring.
bool hasSFINAEDiagnostic() const
Is a SFINAE diagnostic available?
bool hasMatchedPackOnParmToNonPackOnArg() const
void takeSFINAEDiagnostic(PartialDiagnosticAt &PD)
Take ownership of the SFINAE diagnostic.
Defines the clang::TargetInfo interface.
Attr * instantiateTemplateAttribute(const Attr *At, ASTContext &C, Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs)
Attr * instantiateTemplateAttributeForDecl(const Attr *At, ASTContext &C, Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs)
The JSON file list parser is used to communicate input to InstallAPI.
void atTemplateEnd(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema, const Sema::CodeSynthesisContext &Inst)
void atTemplateBegin(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema, const Sema::CodeSynthesisContext &Inst)
@ Specialization
We are substituting template parameters for template arguments in order to form a template specializa...
NamedDecl * getAsNamedDecl(TemplateParameter P)
bool isGenericLambdaCallOperatorOrStaticInvokerSpecialization(const DeclContext *DC)
bool isLambdaCallOperator(const CXXMethodDecl *MD)
@ Result
The result type of a method or function.
std::pair< unsigned, unsigned > getDepthAndIndex(const NamedDecl *ND)
Retrieve the depth and index of a template parameter.
TagTypeKind
The kind of a tag type.
DeductionFailureInfo MakeDeductionFailureInfo(ASTContext &Context, TemplateDeductionResult TDK, sema::TemplateDeductionInfo &Info)
Convert from Sema's representation of template deduction information to the form used in overload-can...
llvm::PointerUnion< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
const FunctionProtoType * T
void printTemplateArgumentList(raw_ostream &OS, ArrayRef< TemplateArgument > Args, const PrintingPolicy &Policy, const TemplateParameterList *TPL=nullptr)
Print a template argument list, including the '<' and '>' enclosing the template arguments.
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs.
TemplateDeductionResult
Describes the result of template argument deduction.
@ Success
Template argument deduction was successful.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ None
No keyword precedes the qualified type name.
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
@ Typename
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
@ EST_Uninstantiated
not instantiated yet
@ EST_None
no exception specification
__DEVICE__ _Tp arg(const std::complex< _Tp > &__c)
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
DeclarationName getName() const
getName - Returns the embedded declaration name.
Holds information about the various types of exception specification.
ExceptionSpecificationType Type
The kind of exception specification this is.
ExceptionSpecInfo ExceptionSpec
A context in which code is being synthesized (where a source location alone is not sufficient to iden...
SourceRange InstantiationRange
The source range that covers the construct that cause the instantiation, e.g., the template-id that c...
enum clang::Sema::CodeSynthesisContext::SynthesisKind Kind
const TemplateArgument * TemplateArgs
The list of template arguments we are substituting, if they are not part of the entity.
sema::TemplateDeductionInfo * DeductionInfo
The template deduction info object associated with the substitution or checking of explicit or deduce...
NamedDecl * Template
The template (or partial specialization) in which we are performing the instantiation,...
SourceLocation PointOfInstantiation
The point of instantiation or synthesis within the source code.
SynthesisKind
The kind of template instantiation we are performing.
@ MarkingClassDllexported
We are marking a class as __dllexport.
@ RequirementParameterInstantiation
@ DefaultTemplateArgumentInstantiation
We are instantiating a default argument for a template parameter.
@ ExplicitTemplateArgumentSubstitution
We are substituting explicit template arguments provided for a function template.
@ DefaultTemplateArgumentChecking
We are checking the validity of a default template argument that has been used when naming a template...
@ InitializingStructuredBinding
We are initializing a structured binding.
@ ExceptionSpecInstantiation
We are instantiating the exception specification for a function template which was deferred until it ...
@ NestedRequirementConstraintsCheck
We are checking the satisfaction of a nested requirement of a requires expression.
@ BuildingBuiltinDumpStructCall
We are building an implied call from __builtin_dump_struct.
@ ParameterMappingSubstitution
@ DefiningSynthesizedFunction
We are defining a synthesized function (such as a defaulted special member).
@ Memoization
Added for Template instantiation observation.
@ ConstraintNormalization
@ LambdaExpressionSubstitution
We are substituting into a lambda expression.
@ TypeAliasTemplateInstantiation
We are instantiating a type alias template declaration.
@ BuildingDeductionGuides
We are building deduction guides for a class.
@ PartialOrderingTTP
We are performing partial ordering for template template parameters.
@ DeducedTemplateArgumentSubstitution
We are substituting template argument determined as part of template argument deduction for either a ...
@ PriorTemplateArgumentSubstitution
We are substituting prior template arguments into a new template parameter.
@ ExceptionSpecEvaluation
We are computing the exception specification for a defaulted special member function.
@ TemplateInstantiation
We are instantiating a template declaration.
@ DeclaringSpecialMember
We are declaring an implicit special member function.
@ DeclaringImplicitEqualityComparison
We are declaring an implicit 'operator==' for a defaulted 'operator<=>'.
@ DefaultFunctionArgumentInstantiation
We are instantiating a default argument for a function.
@ RewritingOperatorAsSpaceship
We are rewriting a comparison operator in terms of an operator<=>.
@ RequirementInstantiation
We are instantiating a requirement of a requires expression.
Decl * Entity
The entity that is being synthesized.
bool isInstantiationRecord() const
Determines whether this template is an actual instantiation that should be counted toward the maximum...
A stack object to be created when performing template instantiation.
bool isInvalid() const
Determines whether we have exceeded the maximum recursive template instantiations.
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation, Decl *Entity, SourceRange InstantiationRange=SourceRange())
Note that we are instantiating a class template, function template, variable template,...
void Clear()
Note that we have finished instantiating this template.
bool isAlreadyInstantiating() const
Determine whether we are already instantiating this specialization in some surrounding active instant...
void set(DeclAccessPair Found, Decl *Spec, DeductionFailureInfo Info)
Contains all information for a given match.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4