[C++ Patch] PR 57397

Paolo Carlini paolo.carlini@oracle.com
Wed Jul 30 17:38:00 GMT 2014


Hi,

On 07/30/2014 07:19 PM, Jason Merrill wrote:
> On 07/30/2014 11:09 AM, Paolo Carlini wrote:
>> +      /* Eg (c++/57397):
>> +
>> +      template<class T1, class... Tn, class... Tm>
>> +      void foo(T1, Tn..., Tm...);
>> +
>> +      int main()
>> +      {
>> +        foo(1, 2);
>> +      }  */
>
> I think we should accept this: T1 is int, Tn is {}, Tm is {int}.
Thus in fact current status is fine, a simpler patch, great.
>
>> +     template<class T1, class... Tn, class... Tm>
>> +     void foo(T1, Tn..., Tm...);
>> +
>> +     int main()
>> +     {
>> +       foo(1);
>> +     }  */
>
> And we should accept this.
To be clear: we do accept this with the patch applied.
>
>
>>        while (p && p != void_list_node)
>>      {
>> -      count++;
>> +      if (TREE_CODE (TREE_VALUE (p)) == TYPE_PACK_EXPANSION)
>> +        trailing_packs = true;
>> +      else
>> +        count++;
>>        p = TREE_CHAIN (p);
>>      }
>
> Only a function parameter pack at the very end should trigger the "at 
> least" message.  Other packs don't matter.
Ok... Let me adjust code and testcases...

Thanks!
Paolo.



More information about the Gcc-patches mailing list