@@ -2682,12 +2682,12 @@ struct ConvertConstructorToDeductionGuideTransform {
2682
2682
SmallVector<unsigned > TemplateParamsReferencedInTemplateArgumentList (
2683
2683
ArrayRef<NamedDecl *> TemplateParams,
2684
2684
ArrayRef<TemplateArgument> DeducedArgs) {
2685
- struct FindAppearedTemplateParams
2686
- : public RecursiveASTVisitor<FindAppearedTemplateParams > {
2685
+ struct ReferenceFinder
2686
+ : public RecursiveASTVisitor<ReferenceFinder > {
2687
2687
llvm::DenseSet<NamedDecl *> TemplateParams;
2688
- llvm::DenseSet<const NamedDecl *> AppearedTemplateParams ;
2688
+ llvm::DenseSet<const NamedDecl *> ReferencedTemplateParams ;
2689
2689
2690
- FindAppearedTemplateParams (ArrayRef<NamedDecl *> TemplateParams)
2690
+ ReferenceFinder (ArrayRef<NamedDecl *> TemplateParams)
2691
2691
: TemplateParams(TemplateParams.begin(), TemplateParams.end()) {}
2692
2692
2693
2693
bool VisitTemplateTypeParmType (TemplateTypeParmType *TTP) {
@@ -2702,15 +2702,15 @@ SmallVector<unsigned> TemplateParamsReferencedInTemplateArgumentList(
2702
2702
2703
2703
void MarkAppeared (NamedDecl *ND) {
2704
2704
if (TemplateParams.contains (ND))
2705
- AppearedTemplateParams .insert (ND);
2705
+ ReferencedTemplateParams .insert (ND);
2706
2706
}
2707
2707
};
2708
- FindAppearedTemplateParams MarkAppeared (TemplateParams);
2709
- MarkAppeared .TraverseTemplateArguments (DeducedArgs);
2708
+ ReferenceFinder Finder (TemplateParams);
2709
+ Finder .TraverseTemplateArguments (DeducedArgs);
2710
2710
2711
2711
SmallVector<unsigned > Results;
2712
2712
for (unsigned Index = 0 ; Index < TemplateParams.size (); ++Index) {
2713
- if (MarkAppeared. AppearedTemplateParams .contains (
2713
+ if (Finder. ReferencedTemplateParams .contains (
2714
2714
TemplateParams[Index]))
2715
2715
Results.push_back (Index);
2716
2716
}
@@ -2911,7 +2911,12 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
2911
2911
Context.getCanonicalTemplateArgument (
2912
2912
Context.getInjectedTemplateArg (NewParam));
2913
2913
}
2914
- // FIXME: support require clause.
2914
+ // FIXME: implement the associated constraint per C++
2915
+ // [over.match.class.deduct]p3.3:
2916
+ // The associated constraints ([temp.constr.decl]) are the
2917
+ // conjunction of the associated constraints of g and a
2918
+ // constraint that is satisfied if and only if the arguments
2919
+ // of A are deducible (see below) from the return type.
2915
2920
auto *FPrimeTemplateParamList = TemplateParameterList::Create (
2916
2921
Context, AliasTemplate->getTemplateParameters ()->getTemplateLoc (),
2917
2922
AliasTemplate->getTemplateParameters ()->getLAngleLoc (),
@@ -2963,12 +2968,6 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
2963
2968
F, TemplateArgListForBuildingFPrime, AliasTemplate->getLocation (),
2964
2969
Sema::CodeSynthesisContext::BuildingDeductionGuides)) {
2965
2970
auto *GG = dyn_cast<CXXDeductionGuideDecl>(FPrime);
2966
- // FIXME: implement the associated constraint per C++
2967
- // [over.match.class.deduct]p3.3:
2968
- // The associated constraints ([temp.constr.decl]) are the
2969
- // conjunction of the associated constraints of g and a
2970
- // constraint that is satisfied if and only if the arguments
2971
- // of A are deducible (see below) from the return type.
2972
2971
buildDeductionGuide (SemaRef, AliasTemplate, FPrimeTemplateParamList,
2973
2972
GG->getCorrespondingConstructor (),
2974
2973
GG->getExplicitSpecifier (), GG->getTypeSourceInfo (),
0 commit comments