re PR c++/49205 ([C++0x] Default constructor with pack expansion parameter not detected)
authorJason Merrill <jason@redhat.com>
Mon, 20 Jun 2011 14:40:10 +0000 (10:40 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 20 Jun 2011 14:40:10 +0000 (10:40 -0400)
PR c++/49205
* call.c (sufficient_parms_p): Allow parameter packs too.

From-SVN: r175214

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic-default.C [new file with mode: 0644]

index 1746670c520ee8f53ca7f229b1f9614aa97e7fab..87e5164d9b6c5a969864edb55dff6c73084e8320 100644 (file)
@@ -1,5 +1,8 @@
 2011-06-20  Jason Merrill  <jason@redhat.com>
 
+       PR c++/49205
+       * call.c (sufficient_parms_p): Allow parameter packs too.
+
        PR c++/43321
        * semantics.c (describable_type): Remove.
        * cp-tree.h: Likewise.
index 05bf983f558ffa3fe8833334fce9b0a1a410eb8d..09d73d0c4c5a4e582099847bbc1d5bfed2a2e69d 100644 (file)
@@ -534,15 +534,16 @@ null_ptr_cst_p (tree t)
   return false;
 }
 
-/* Returns nonzero if PARMLIST consists of only default parms and/or
-   ellipsis.  */
+/* Returns nonzero if PARMLIST consists of only default parms,
+   ellipsis, and/or undeduced parameter packs.  */
 
 bool
 sufficient_parms_p (const_tree parmlist)
 {
   for (; parmlist && parmlist != void_list_node;
        parmlist = TREE_CHAIN (parmlist))
-    if (!TREE_PURPOSE (parmlist))
+    if (!TREE_PURPOSE (parmlist)
+       && !PACK_EXPANSION_P (TREE_VALUE (parmlist)))
       return false;
   return true;
 }
index 6bfc81b0838de9167123056072e054d279fcb5e1..abc624597dab6de6abcd60f44a4d655b63679ba3 100644 (file)
@@ -1,5 +1,8 @@
 2011-06-20  Jason Merrill  <jason@redhat.com>
 
+       PR c++/49205
+       * g++.dg/cpp0x/variadic-default.C: New.
+
        PR c++/43321
        * g++.dg/cpp0x/auto26.C: New.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-default.C b/gcc/testsuite/g++.dg/cpp0x/variadic-default.C
new file mode 100644 (file)
index 0000000..2625e25
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/49205
+// { dg-options -std=c++0x }
+
+#include <initializer_list>
+
+struct A {
+  template<typename ...T> A(T...);
+  A(std::initializer_list<short>);
+  A(std::initializer_list<long>);
+};
+
+A a{};