This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 57397


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]