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


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}.

+     template<class T1, class... Tn, class... Tm>
+     void foo(T1, Tn..., Tm...);
+
+     int main()
+     {
+       foo(1);
+     }  */

And we should accept this.

       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.

Jason


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