In a partial instantiation of a pack expansion we can have a situation where we have arguments for some of the packs but not all. We deal with this by leaving the pattern uninstantiated and remembering the arguments passed to the partial specialization so we can use them later in doing a full instantiation. My patch for 84036 started to use this mechanism when we don't have the expansion of a function parameter pack, but it broke for this testcase because when we went to look for the local specialization of the function parameter pack, we were looking for a specialization of the original parameter pack, but local_specializations only knows about the partially instantiated parameter pack. Fixed by remembering in this situation what function we are using parameter packs from, so we can set up the appropriate mapping. Tested x86_64-pc-linux-gnu, applying to trunk.