public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Dodji Seketeli <dodji@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack
Date: Fri, 16 Nov 2012 22:39:00 -0000	[thread overview]
Message-ID: <50A6C0B0.8070407@redhat.com> (raw)
In-Reply-To: <m3haqtozhj.fsf@redhat.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 
PACK_EXPANSION_EXTRA_ARGS mechanism.

> +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?

Jason

  parent reply	other threads:[~2012-11-16 22:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20  9:05 Dodji Seketeli
2012-11-16 13:16 ` [PING] " Dodji Seketeli
2012-11-16 22:39 ` Jason Merrill [this message]
2012-12-03 13:28   ` Dodji Seketeli
2012-12-05 16:01     ` Jason Merrill
2012-12-08 22:12       ` Dodji Seketeli
2012-12-10 22:38         ` Jason Merrill
2012-12-11 15:55           ` Dodji Seketeli
2012-12-11 16:40             ` Jason Merrill
2012-12-11 21:10               ` Dodji Seketeli
2012-12-11 21:26                 ` Jason Merrill
2012-12-12 13:28                   ` Dodji Seketeli
2012-12-17 19:03                     ` Jason Merrill
2012-12-19 18:21                       ` Dodji Seketeli
2013-01-19  1:49                         ` Jason Merrill
2013-01-21 20:09                           ` Dodji Seketeli
2013-01-21 20:44                             ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50A6C0B0.8070407@redhat.com \
    --to=jason@redhat.com \
    --cc=dodji@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).