@@ -10930,32 +10930,15 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer(
10930
10930
Context.getLValueReferenceType (ElementTypes[I].withConst ());
10931
10931
}
10932
10932
10933
- llvm::FoldingSetNodeID ID;
10934
- ID.AddPointer (Template);
10935
- for (auto &T : ElementTypes)
10936
- T.getCanonicalType ().Profile (ID);
10937
- unsigned Hash = ID.ComputeHash ();
10938
- if (AggregateDeductionCandidates.count (Hash) == 0 ) {
10939
- if (FunctionTemplateDecl *TD =
10940
- DeclareImplicitDeductionGuideFromInitList (
10941
- Template, ElementTypes,
10942
- TSInfo->getTypeLoc ().getEndLoc ())) {
10943
- auto *GD = cast<CXXDeductionGuideDecl>(TD->getTemplatedDecl ());
10944
- GD->setDeductionCandidateKind (DeductionCandidate::Aggregate);
10945
- AggregateDeductionCandidates[Hash] = GD;
10946
- addDeductionCandidate (TD, GD, DeclAccessPair::make (TD, AS_public),
10947
- OnlyListConstructors,
10948
- /* AllowAggregateDeductionCandidate=*/ true );
10949
- }
10950
- } else {
10951
- CXXDeductionGuideDecl *GD = AggregateDeductionCandidates[Hash];
10952
- FunctionTemplateDecl *TD = GD->getDescribedFunctionTemplate ();
10953
- assert (TD && " aggregate deduction candidate is function template" );
10933
+ if (FunctionTemplateDecl *TD =
10934
+ DeclareImplicitDeductionGuideFromInitList (
10935
+ Template, ElementTypes, TSInfo->getTypeLoc ().getEndLoc ())) {
10936
+ auto *GD = cast<CXXDeductionGuideDecl>(TD->getTemplatedDecl ());
10954
10937
addDeductionCandidate (TD, GD, DeclAccessPair::make (TD, AS_public),
10955
10938
OnlyListConstructors,
10956
10939
/* AllowAggregateDeductionCandidate=*/ true );
10940
+ HasAnyDeductionGuide = true ;
10957
10941
}
10958
- HasAnyDeductionGuide = true ;
10959
10942
}
10960
10943
};
10961
10944
0 commit comments