@@ -1072,17 +1072,19 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
10721072 AliasRhsTemplateArgs, TDeduceInfo, DeduceResults,
10731073 /* NumberOfArgumentsMustMatch=*/ false );
10741074
1075- static auto IsNonDeducedArgument = [&](const DeducedTemplateArgument &TA) {
1076- // The following cases indicate the template argument is non-deducible:
1077- // 1. The result is null. E.g. When it comes from a default template
1078- // argument that doesn't appear in the alias declaration.
1079- // 2. The template parameter is a pack and that cannot be deduced from
1080- // the arguments within the alias declaration.
1081- // Non-deducible template parameters will persist in the transformed
1082- // deduction guide.
1083- return TA.isNull () || (TA.getKind () == TemplateArgument::Pack &&
1084- TA.pack_size () == 1 && TA.pack_begin ()->isNull ());
1085- };
1075+ static std::function<bool (const TemplateArgument &TA)> IsNonDeducedArgument =
1076+ [](const TemplateArgument &TA) {
1077+ // The following cases indicate the template argument is non-deducible:
1078+ // 1. The result is null. E.g. When it comes from a default template
1079+ // argument that doesn't appear in the alias declaration.
1080+ // 2. The template parameter is a pack and that cannot be deduced from
1081+ // the arguments within the alias declaration.
1082+ // Non-deducible template parameters will persist in the transformed
1083+ // deduction guide.
1084+ return TA.isNull () ||
1085+ (TA.getKind () == TemplateArgument::Pack &&
1086+ llvm::any_of (TA.pack_elements (), IsNonDeducedArgument));
1087+ };
10861088
10871089 SmallVector<TemplateArgument> DeducedArgs;
10881090 SmallVector<unsigned > NonDeducedTemplateParamsInFIndex;
0 commit comments