Lines Matching full:pack

349           // template <class... Pack> struct S {  in HandleFunctionTemplateDecl()
352 // template <class... Pack> template <class T> in HandleFunctionTemplateDecl()
354 // They're of kind TemplateArgument::Pack, not of in HandleFunctionTemplateDecl()
356 // void S<Pack...>::foo() {} in HandleFunctionTemplateDecl()
362 // for unexpanded parameters should be of a Pack kind. in HandleFunctionTemplateDecl()
1387 std::optional<unsigned> getPackIndex(TemplateArgument Pack) { in getPackIndex() argument
1391 return Pack.pack_size() - 1 - Index; in getPackIndex()
1407 void ExpandingFunctionParameterPack(ParmVarDecl *Pack) { in ExpandingFunctionParameterPack() argument
1408 SemaRef.CurrentInstantiationScope->MakeInstantiatedLocalArgPack(Pack); in ExpandingFunctionParameterPack()
1460 "should only have multiple expansions for a pack"); in transformedLocalDecl()
1549 /// Transform a reference to a function or init-capture parameter pack.
1553 /// expand a function parameter pack reference which refers to an expanded
1554 /// pack.
1582 // Override the default version to handle a rewrite-template-arg-pack case
1590 case TemplateArgument::Pack: in TransformTemplateArgument()
1591 // Literally rewrite the template argument pack, instead of unpacking in TransformTemplateArgument()
1593 for (auto &pack : Arg.getPackAsArray()) { in TransformTemplateArgument() local
1595 pack, QualType(), SourceLocation{}); in TransformTemplateArgument()
1635 /// Transforms an already-substituted template type parameter pack
1636 /// into either itself (if we aren't substituting into its pack expansion)
1830 assert(Arg.getKind() == TemplateArgument::Pack && in TransformDecl()
1831 "Missing argument pack"); in TransformDecl()
1881 assert(Arg.getKind() == TemplateArgument::Pack && in TransformFirstQualifierInScope()
1882 "Missing argument pack"); in TransformFirstQualifierInScope()
1979 if (Arg.getKind() == TemplateArgument::Pack) { in TransformTemplateName()
1981 "unexpected pack arguments in template rewrite"); in TransformTemplateName()
1993 assert(Arg.getKind() == TemplateArgument::Pack && in TransformTemplateName()
1994 "Missing argument pack"); in TransformTemplateName()
1997 // We have the template argument pack to substitute, but we're not in TransformTemplateName()
1998 // actually expanding the enclosing pack expansion yet. So, just in TransformTemplateName()
1999 // keep the entire argument pack. in TransformTemplateName()
2023 TemplateArgument Pack = SubstPack->getArgumentPack(); in TransformTemplateName() local
2025 getPackSubstitutedTemplateArgument(getSema(), Pack).getAsTemplate(); in TransformTemplateName()
2030 getPackIndex(Pack)); in TransformTemplateName()
2062 if (Arg.getKind() == TemplateArgument::Pack) { in TransformTemplateParmRefExpr()
2064 "unexpected pack arguments in template rewrite"); in TransformTemplateParmRefExpr()
2077 assert(Arg.getKind() == TemplateArgument::Pack && in TransformTemplateParmRefExpr()
2078 "Missing argument pack"); in TransformTemplateParmRefExpr()
2081 // We have an argument pack, but we can't select a particular argument in TransformTemplateParmRefExpr()
2083 // argument pack. in TransformTemplateParmRefExpr()
2250 // We aren't expanding the parameter pack, so just return ourselves. in TransformSubstNonTypeTemplateParmPackExpr()
2254 TemplateArgument Pack = E->getArgumentPack(); in TransformSubstNonTypeTemplateParmPackExpr() local
2255 TemplateArgument Arg = getPackSubstitutedTemplateArgument(getSema(), Pack); in TransformSubstNonTypeTemplateParmPackExpr()
2259 E->getParameterPackLocation(), Arg, getPackIndex(Pack)); in TransformSubstNonTypeTemplateParmPackExpr()
2314 // We can expand this parameter pack now. in TransformFunctionParmPackExpr()
2351 assert(Found && "no instantiation for parameter pack"); in TransformFunctionParmPackRefExpr()
2354 if (DeclArgumentPack *Pack = Found->dyn_cast<DeclArgumentPack *>()) { in TransformFunctionParmPackRefExpr() local
2355 // If this is a reference to a function parameter pack which we can in TransformFunctionParmPackRefExpr()
2362 E->getExprLoc(), *Pack); in TransformFunctionParmPackRefExpr()
2367 TransformedDecl = (*Pack)[getSema().ArgumentPackSubstitutionIndex]; in TransformFunctionParmPackRefExpr()
2372 // We have either an unexpanded pack or a specific expansion. in TransformFunctionParmPackRefExpr()
2485 if (Arg.getKind() == TemplateArgument::Pack) { in TransformTemplateTypeParmType()
2487 "unexpected pack arguments in template rewrite"); in TransformTemplateTypeParmType()
2501 assert(Arg.getKind() == TemplateArgument::Pack && in TransformTemplateTypeParmType()
2502 "Missing argument pack"); in TransformTemplateTypeParmType()
2505 // We have the template argument pack, but we're not expanding the in TransformTemplateTypeParmType()
2506 // enclosing pack expansion yet. Just save the template argument in TransformTemplateTypeParmType()
2507 // pack for later substitution. in TransformTemplateTypeParmType()
2553 // We aren't expanding the parameter pack, so just return ourselves. in TransformSubstTemplateTypeParmPackType()
2564 TemplateArgument Pack = T->getArgumentPack(); in TransformSubstTemplateTypeParmPackType() local
2565 TemplateArgument Arg = getPackSubstitutedTemplateArgument(getSema(), Pack); in TransformSubstTemplateTypeParmPackType()
2568 getPackIndex(Pack), Arg, TL.getNameLoc()); in TransformSubstTemplateTypeParmPackType()
3081 // We have a function parameter pack. Substitute into the pattern of the in SubstParmVarDecl()
3090 // our function parameter is still a function parameter pack. in SubstParmVarDecl()
3091 // Therefore, make its type a pack expansion type. in SubstParmVarDecl()
3095 // We expected to get a parameter pack but didn't (because the type in SubstParmVarDecl()
3096 // itself is not a pack expansion type), so complain. This can occur when in SubstParmVarDecl()
3098 // pack expansion. in SubstParmVarDecl()
3173 // Add the new parameter to the instantiated parameter pack. in SubstParmVarDecl()
3309 // This is a pack expansion. See whether we should expand it now, or in SubstBaseSpecifiers()
3327 // If we should expand this pack expansion now, do so. in SubstBaseSpecifiers()
3356 // The resulting base specifier will (still) be a pack expansion. in SubstBaseSpecifiers()
4415 } else if (DeclArgumentPack *Pack = Stored.dyn_cast<DeclArgumentPack *>()) { in InstantiatedLocal() local
4416 Pack->push_back(cast<VarDecl>(Inst)); in InstantiatedLocal()
4425 DeclArgumentPack *Pack = LocalDecls[D].get<DeclArgumentPack *>(); in InstantiatedLocalPackArg() local
4426 Pack->push_back(Inst); in InstantiatedLocalPackArg()
4435 "Creating local pack after instantiation of local"); in MakeInstantiatedLocalArgPack()
4440 DeclArgumentPack *Pack = new DeclArgumentPack; in MakeInstantiatedLocalArgPack() local
4441 Stored = Pack; in MakeInstantiatedLocalArgPack()
4442 ArgumentPacks.push_back(Pack); in MakeInstantiatedLocalArgPack()
4446 for (DeclArgumentPack *Pack : ArgumentPacks) in isLocalPackExpansion()
4447 if (llvm::is_contained(*Pack, D)) in isLocalPackExpansion()
4452 void LocalInstantiationScope::SetPartiallySubstitutedPack(NamedDecl *Pack, in SetPartiallySubstitutedPack() argument
4455 assert((!PartiallySubstitutedPack || PartiallySubstitutedPack == Pack) && in SetPartiallySubstitutedPack()
4456 "Already have a partially-substituted pack"); in SetPartiallySubstitutedPack()
4459 "Wrong number of arguments in partially-substituted pack"); in SetPartiallySubstitutedPack()
4460 PartiallySubstitutedPack = Pack; in SetPartiallySubstitutedPack()