This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack
- From: Jason Merrill <jason at redhat dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Nov 2012 17:39:44 -0500
- Subject: Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack
- References: <email@example.com>
It seems like your new code is a generalization of the old code for
handling substitution of a pack for itself (arg_from_parm_pack and such)
and the code for handling other packs with a single pack expansion
argument, and should replace those rather than adding on.
The solution that if at a certain index all the packs have expansion
arguments then the substitution produces a pack expansion seems right to
me, but if one pack has an expansion and another pack has a normal
argument, we can't do the substitution and need to fall back on the
+set_arg_pack_select_index_for_pack_expansion (tree aps,
+ int i,
+ tree arg_pack)
+ if (any_non_real_argument_pack_element_p (arg_pack))
I don't think we care if *any* element is an expansion (and please talk
about expansions rather than "non-real elements"). What we care about
is whether the i'th element is an expansion. And we need to compare all
the pack elements, so I think this needs to be handled in the main
function rather than encapsulated here.
+ TREE_VEC_ELT (args_vec, i) =
+ TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), i);
Aren't the LHS and RHS the same location here?