On 12/08/2012 05:12 PM, Dodji Seketeli wrote:
+  else if (arg_from_pack_level_to_prune || has_empty_arg)
+    {
+      /* ... we just return a pack expansion which pattern is PATTERN
+        into which ARGS has been substituted.  */
+      *instantiation_yields_no_list_p = true;
+    }

Though I think it would still be appropriate to keep this 'if' just to
avoid going into the 'else' block for cases where we know that looping
over the parameter packs (and do the ARGUMENT_PACK_SELECT dance) is
unnecessary; all we want is to go straight to the point where we
substitute args into the pattern, build a pack expansion and return
it.  Or isn't what you meant?

I suppose we should keep this for has_empty_arg, but I'd like to do away with special handling of the arg_from_parm_pack case if possible, as it's a lot of extra complexity.

My understanding is that in practise, we never hit this point in the
previous code.  The reason why len would still be negative at this
point would be if we didn't find any (good) argument pack.  But in
that case, we would have considered that we have unsubstituted packs
and would have returned an unsubstituted pack expansion before we
reach this point.

I don't see that; in the old code, if there are unsubstituted packs we tsubst the args into the pattern.

+      /* We got some full packs, but we can't substitute them in until we
+        have values for all the packs.  So remember these until then.  */

How can having this in gen_elem_of_pack_expansion_instantiation could work? We don't want an expansion for each element of the packs that we have.

Jason

Reply via email to