Lines Matching full:pack

364   case TemplateArgument::Pack: {  in checkDeducedTemplateArguments()
365 if (Y.getKind() != TemplateArgument::Pack || in checkDeducedTemplateArguments()
424 // expanded NTTP should be a pack expansion type? in DeduceNonTypeTemplateArgument()
810 /// A pack that we're currently deducing.
812 // The index of the pack.
815 // The old value of the pack before we started deducing it.
818 // A deferred value of this pack from an inner deduction, that couldn't be
822 // The new value of the pack.
825 // The outer deduction for this pack, if any.
833 /// A scope in which we're performing pack deduction.
858 // Save the deduced template argument for the parameter pack expanded in addPack()
859 // by this pack expansion, then clear out the deduction. in addPack()
861 DeducedPack Pack(Index); in addPack() local
862 Pack.Saved = Deduced[Index]; in addPack()
872 Packs.push_back(Pack); in addPack()
877 // parameter packs expanded by the pack expansion. in addPacks()
887 // Deducing a parameter pack that is a pack expansion also constrains the in addPacks()
898 // parameter packs that are pack expansions. in addPacks()
914 assert(!Packs.empty() && "Pack expansion without unexpanded packs?"); in addPacks()
927 // Dig out the partially-substituted pack, if there is one. in finishConstruction()
936 // This pack expansion will have been partially or fully expanded if in finishConstruction()
952 // Skip over the pack elements that were expanded into separate arguments. in finishConstruction()
959 for (auto &Pack : Packs) { in finishConstruction() local
960 if (Info.PendingDeducedPacks.size() > Pack.Index) in finishConstruction()
961 Pack.Outer = Info.PendingDeducedPacks[Pack.Index]; in finishConstruction()
963 Info.PendingDeducedPacks.resize(Pack.Index + 1); in finishConstruction()
964 Info.PendingDeducedPacks[Pack.Index] = &Pack; in finishConstruction()
967 std::make_pair(Info.getDeducedDepth(), Pack.Index)) { in finishConstruction()
968 Pack.New.append(PartialPackArgs, PartialPackArgs + NumPartialPackArgs); in finishConstruction()
970 // pack with the specified value. This is not entirely correct: the in finishConstruction()
974 // FIXME: If we could represent a "depth i, index j, pack elem k" in finishConstruction()
975 // parameter, we could substitute the partially-substituted pack in finishConstruction()
978 Deduced[Pack.Index] = Pack.New[PackElements]; in finishConstruction()
985 for (auto &Pack : Packs) in ~PackDeductionScope() local
986 Info.PendingDeducedPacks[Pack.Index] = Pack.Outer; in ~PackDeductionScope()
1000 /// Determine whether this pack has already been deduced from a previous
1006 /// Determine whether this pack has already been partially expanded into a
1010 /// Determine whether this pack expansion scope has a known, fixed arity.
1011 /// This happens if it involves a pack from an outer template that has
1016 /// pack. This is the case unless the pack is already expanded to a fixed
1022 /// Move to deducing the next element in each pack that is being deduced.
1024 // Capture the deduced template arguments for each parameter pack expanded in nextPackElement()
1025 // by this pack expansion, add them to the list of arguments we've deduced in nextPackElement()
1026 // for that pack, then clear out the deduced argument. in nextPackElement()
1027 for (auto &Pack : Packs) { in nextPackElement() local
1028 DeducedTemplateArgument &DeducedArg = Deduced[Pack.Index]; in nextPackElement()
1029 if (!Pack.New.empty() || !DeducedArg.isNull()) { in nextPackElement()
1030 while (Pack.New.size() < PackElements) in nextPackElement()
1031 Pack.New.push_back(DeducedTemplateArgument()); in nextPackElement()
1032 if (Pack.New.size() == PackElements) in nextPackElement()
1033 Pack.New.push_back(DeducedArg); in nextPackElement()
1035 Pack.New[PackElements] = DeducedArg; in nextPackElement()
1036 DeducedArg = Pack.New.size() > PackElements + 1 in nextPackElement()
1037 ? Pack.New[PackElements + 1] in nextPackElement()
1049 // pack expansion. in finish()
1050 for (auto &Pack : Packs) { in finish() local
1051 // Put back the old value for this pack. in finish()
1052 Deduced[Pack.Index] = Pack.Saved; in finish()
1054 // Always make sure the size of this pack is correct, even if we didn't in finish()
1059 // pack is not equal to the number of elements we processed. (Either that in finish()
1067 Pack.New.resize(PackElements); in finish()
1069 // Build or find a new value for this pack. in finish()
1071 if (Pack.New.empty()) { in finish()
1072 // If we deduced an empty argument pack, create it now. in finish()
1076 new (S.Context) TemplateArgument[Pack.New.size()]; in finish()
1077 std::copy(Pack.New.begin(), Pack.New.end(), ArgumentPack); in finish()
1079 TemplateArgument(llvm::ArrayRef(ArgumentPack, Pack.New.size())), in finish()
1080 // FIXME: This is wrong, it's possible that some pack elements are in finish()
1085 Pack.New[0].wasDeducedFromArrayBound()); in finish()
1088 // Pick where we're going to put the merged pack. in finish()
1090 if (Pack.Outer) { in finish()
1091 if (Pack.Outer->DeferredDeduction.isNull()) { in finish()
1092 // Defer checking this pack until we have a complete pack to compare in finish()
1094 Pack.Outer->DeferredDeduction = NewPack; in finish()
1097 Loc = &Pack.Outer->DeferredDeduction; in finish()
1099 Loc = &Deduced[Pack.Index]; in finish()
1102 // Check the new pack matches any previous value. in finish()
1108 OldPack.getKind() == TemplateArgument::Pack && in finish()
1109 NewPack.getKind() == TemplateArgument::Pack && in finish()
1112 // If we deferred a deduction of this pack, check that one now too. in finish()
1113 if (!Result.isNull() && !Pack.DeferredDeduction.isNull()) { in finish()
1115 NewPack = Pack.DeferredDeduction; in finish()
1119 NamedDecl *Param = TemplateParams->getParam(Pack.Index); in finish()
1127 // If we have a pre-expanded pack and we didn't deduce enough elements in finish()
1152 /// The number of expansions, if we have a fully-expanded pack in this scope.
1217 // parameter pack and the function parameter associated with P is not in DeduceTemplateArguments()
1218 // a function parameter pack, then template argument deduction fails. in DeduceTemplateArguments()
1236 // parameter pack, then the type of its declarator- id is compared with in DeduceTemplateArguments()
1239 // template parameter packs expanded by the function parameter pack. in DeduceTemplateArguments()
1244 // A pack scope with fixed arity is not really a pack any more, so is not in DeduceTemplateArguments()
1261 // - A function parameter pack that does not occur at the end of the in DeduceTemplateArguments()
1270 // with a non-trailing pack-expansion in its arguments, which renders the in DeduceTemplateArguments()
1273 // If the parameter type contains an explicitly-specified pack that we in DeduceTemplateArguments()
1285 // pack expansion. in DeduceTemplateArguments()
1294 // During partial ordering, if Ai was originally a function parameter pack: in DeduceTemplateArguments()
1530 // If the argument type is a pack expansion, look at its pattern. in DeduceTemplateArgumentsByTypeMatch()
1718 // pack, do nothing: we don't know which of its arguments to look in DeduceTemplateArgumentsByTypeMatch()
2419 // If the template argument is a pack expansion, perform template argument in DeduceTemplateArguments()
2447 llvm_unreachable("caller should handle pack expansions"); in DeduceTemplateArguments()
2509 case TemplateArgument::Pack: in DeduceTemplateArguments()
2519 case TemplateArgument::Pack: in DeduceTemplateArguments()
2540 if (Arg.getKind() != TemplateArgument::Pack) in hasTemplateArgumentForDeduction()
2543 assert(ArgIdx == Args.size() - 1 && "Pack not at the end of argument list?"); in hasTemplateArgumentForDeduction()
2549 /// Determine whether the given set of template arguments has a pack
2557 if (A.getKind() == TemplateArgument::Pack) in hasPackExpansionBeforeEnd()
2560 // FIXME: If this is a fixed-arity pack expansion from an outer level of in hasPackExpansionBeforeEnd()
2561 // templates, it should not be treated as a pack expansion. in hasPackExpansionBeforeEnd()
2579 // If the template argument list of P contains a pack expansion that is not in DeduceTemplateArguments()
2602 // During partial ordering, if Ai was originally a pack expansion [and] in DeduceTemplateArguments()
2603 // Pi is not a pack expansion, template argument deduction fails. in DeduceTemplateArguments()
2621 // The parameter is a pack expansion. in DeduceTemplateArguments()
2624 // If Pi is a pack expansion, then the pattern of Pi is compared with in DeduceTemplateArguments()
2633 // Keep track of the deduced template arguments for each parameter pack in DeduceTemplateArguments()
2634 // expanded by this pack expansion (the outer index) and for each in DeduceTemplateArguments()
2652 // pack expansion. in DeduceTemplateArguments()
2718 case TemplateArgument::Pack: { in isSameTemplateArg()
2725 // During partial ordering, if Ai was originally a pack expansion: in isSameTemplateArg()
2807 case TemplateArgument::Pack: in getTrivialTemplateArgumentLoc()
2847 if (Arg.getKind() == TemplateArgument::Pack) { in ConvertDeducedTemplateArgument()
2848 // This is a template argument pack, so check each of its arguments against in ConvertDeducedTemplateArgument()
2858 assert(InnerArg.getKind() != TemplateArgument::Pack && in ConvertDeducedTemplateArgument()
2859 "deduced nested pack"); in ConvertDeducedTemplateArgument()
2861 // We deduced arguments for some elements of this pack, but not for in ConvertDeducedTemplateArgument()
2863 // context in a pack expansion (such as an overload set in one of the in ConvertDeducedTemplateArgument()
2873 // Move the converted template argument into our argument pack. in ConvertDeducedTemplateArgument()
2878 // If the pack is empty, we still need to substitute into the parameter in ConvertDeducedTemplateArgument()
2903 // Create the resulting argument pack. in ConvertDeducedTemplateArgument()
2932 // A trailing template parameter pack (14.5.3) not otherwise deduced will in ConvertDeducedTemplateArguments()
2945 // template parameter pack (that may or may not have been extended in ConvertDeducedTemplateArguments()
2949 // Forget the partially-substituted pack; its substitution is now in ConvertDeducedTemplateArguments()
3501 // If we deduced template arguments for a template parameter pack, in SubstituteExplicitTemplateArguments()
3502 // note that the template argument pack is partially substituted and record in SubstituteExplicitTemplateArguments()
3504 // for this template parameter pack. in SubstituteExplicitTemplateArguments()
3508 if (Arg.getKind() == TemplateArgument::Pack) { in SubstituteExplicitTemplateArguments()
3510 // If this is a fully-saturated fixed-size pack, it should be in SubstituteExplicitTemplateArguments()
3605 // parameter pack, however, will be set to NULL since the deduction in SubstituteExplicitTemplateArguments()
3606 // mechanism handles the partially-substituted argument pack directly. in SubstituteExplicitTemplateArguments()
3736 /// Find the pack index for a particular parameter index in an instantiation of
3739 /// \return The pack index for whichever pack produced this parameter, or -1
3758 return -1; // Not a pack expansion in getPackIndexForParam()
3957 // FIXME: This presumably means a pack ended up smaller than we in FinishTemplateArgumentDeduction()
4493 // For a function parameter pack that occurs at the end of the in DeduceTemplateArguments()
4496 // function parameter pack. Each comparison deduces template arguments in DeduceTemplateArguments()
4498 // the function parameter pack. When a function parameter pack appears in DeduceTemplateArguments()
4500 // that parameter pack is never deduced. in DeduceTemplateArguments()
4502 // FIXME: The above rule allows the size of the parameter pack to change in DeduceTemplateArguments()
4504 // we instead notionally deduce the pack against N arguments, where N is in DeduceTemplateArguments()
4505 // the length of the explicitly-specified pack if it's expanded by the in DeduceTemplateArguments()
4506 // parameter pack and 0 otherwise, and we treat each deduction as a in DeduceTemplateArguments()
4518 // If the parameter type contains an explicitly-specified pack that we in DeduceTemplateArguments()
4539 // If we have a trailing parameter pack, that has been deduced in DeduceTemplateArguments()
4540 // previously we substitute the pack here in a similar fashion as in DeduceTemplateArguments()
4565 // pack expansion. in DeduceTemplateArguments()
5617 // ... and if G has a trailing function parameter pack for which F does not in getMoreSpecializedTemplate()
5619 // function parameter pack, then F is more specialized than G. in getMoreSpecializedTemplate()
5659 if (TA1.getKind() == TemplateArgument::Pack) { in getMoreSpecializedTemplate()
5663 assert(TA2.getKind() == TemplateArgument::Pack); in getMoreSpecializedTemplate()
6022 if (TA1.getKind() == TemplateArgument::Pack) { in getMoreSpecialized()
6026 assert(TA2.getKind() == TemplateArgument::Pack); in getMoreSpecialized()
6178 // Unwrap packs that getInjectedTemplateArgs wrapped around pack in isTemplateTemplateParameterAtLeastAsSpecializedAs()
6181 if (Arg.getKind() == TemplateArgument::Pack) { in isTemplateTemplateParameterAtLeastAsSpecializedAs()
6290 // We can deduce from a pack expansion. in MarkUsedTemplateParameters()
6474 // -- A function parameter pack that does not occur at the end of the in MarkUsedTemplateParameters()
6482 // When a function parameter pack appears in a non-deduced context, in MarkUsedTemplateParameters()
6483 // the type of that pack is never deduced. in MarkUsedTemplateParameters()
6522 // If the template argument list of P contains a pack expansion that is in MarkUsedTemplateParameters()
6687 case TemplateArgument::Pack: in MarkUsedTemplateParameters()
6706 // If the template argument list of P contains a pack expansion that is not in MarkUsedTemplateParameters()