Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2013-01-21 Thread Jason Merrill
On 01/21/2013 03:09 PM, Dodji Seketeli wrote: + ith_elem_is_expansion |= + PACK_EXPANSION_P (TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), + index)); Let's use argument_pack_element_is_expansion_p here, too. + /* Do we need to use the PACK_EXP

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2013-01-21 Thread Dodji Seketeli
Jason Merrill writes: > On 12/19/2012 01:21 PM, Dodji Seketeli wrote: >> + tree aps; /* instance of ARGUMENT_PACK_SELECT >> + tree. */ > > Odd comment formatting. Oops, sorry for that. Fixed now. > >> + /* We could not find any argument p

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2013-01-18 Thread Jason Merrill
Sorry it's taken so long for me to respond to this; I forgot about it over the holiday break. The patch is in good shape now, just a few tweaks left: On 12/19/2012 01:21 PM, Dodji Seketeli wrote: + tree aps;/* instance of ARGUMENT_PACK_SELECT +

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-19 Thread Dodji Seketeli
How about the below? gcc/cp/ * pt.c (argument_pack_element_is_expansion_p) (make_argument_pack_select, use_pack_expansion_extra_args_p) (gen_elem_of_pack_expansion_instantiation): New static functions. (has_bare_parameter_packs): Factorized out of ...

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-17 Thread Jason Merrill
On 12/12/2012 08:01 AM, Dodji Seketeli wrote: Jason Merrill writes: I'd also like to move the scan and PACK_EXPANSION_EXTRA_ARGS code back out of the loop. Like this? Let's put this scanning back in the loop over the packs that we already have in the main function. + if (argumen

[PING] Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-17 Thread Dodji Seketeli
Ping? --- Begin Message --- Jason Merrill writes: > 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 substitut

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-12 Thread Dodji Seketeli
Jason Merrill writes: > I'd also like to move the scan and PACK_EXPANSION_EXTRA_ARGS code back > out of the loop. Like this? Tested on x86_64-unknown-linux-gnu against trunk. gcc/cp/ * pt.c (argument_pack_element_is_expansion_p) (make_argument_pack_select, scan_parm_packs_and

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-11 Thread Jason Merrill
On 12/11/2012 04:09 PM, Dodji Seketeli wrote: OK. The below should hopefully approach what you have in mind. Thanks, that's closer to what I was thinking. I'd also like to move the scan and PACK_EXPANSION_EXTRA_ARGS code back out of the loop. Jason

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-11 Thread Dodji Seketeli
Jason Merrill writes: > On 12/11/2012 10:55 AM, Dodji Seketeli wrote: >> Oops, it seems I was too hasty in trying to do away with the >> instantiation_yields_no_list_p parameter to >> gen_elem_of_pack_expansion_instantiation. > > I still think that the elem function should just deal with the sing

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-11 Thread Jason Merrill
On 12/11/2012 10:55 AM, Dodji Seketeli wrote: Oops, it seems I was too hasty in trying to do away with the instantiation_yields_no_list_p parameter to gen_elem_of_pack_expansion_instantiation. I still think that the elem function should just deal with the single element case; the cases where w

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-11 Thread Dodji Seketeli
Jason Merrill writes: > 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. */ > >>> + *instant

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-10 Thread Jason Merrill
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

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-08 Thread Dodji Seketeli
Jason Merrill writes: > On 12/03/2012 08:27 AM, Dodji Seketeli wrote: > > + - HAS_EXPANSION_ARG_P: Set to TRUE iff at least one parameter > > + pack has got an argument that is an expansion. > > The "got" is unnecessary, just "has an argument" is better. Removed, thanks. > > + Setup AP

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-05 Thread Jason Merrill
On 12/03/2012 08:27 AM, Dodji Seketeli wrote: + - HAS_EXPANSION_ARG_P: Set to TRUE iff at least one parameter + pack has got an argument that is an expansion. The "got" is unnecessary, just "has an argument" is better. + Setup APS, which is an instance of an ARGUMENT_PACK_SELE

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-12-03 Thread Dodji Seketeli
Jason Merrill writes: > 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.

Re: [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-11-16 Thread Jason Merrill
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 ce

[PING] [PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-11-16 Thread Dodji Seketeli
I am friendly pinging the patch below ... Dodji Seketeli a écrit: > Hello, > > Consider this example: > > 1template struct List {}; > 2template struct Z {static const int value = T;}; > 3template using LZ = List...>; > 4 > 5template >

[PATCH] PR c++/53609 - Wrong argument deduction for pack expansion in argument pack

2012-09-20 Thread Dodji Seketeli
Hello, Consider this example: 1 template struct List {}; 2 template struct Z {static const int value = T;}; 3 template using LZ = List...>; 4 5 template 6 struct F 7 { 8using N = LZ; //#1 This should amount to List...> 9 } 10 11 F,