commit 9f50baae331019464a94de275ae370cfebb30600
Author: Jason Merrill <jason@redhat.com>
Date: Sun Jun 19 21:55:11 2011 -0400
PR c++/49205
* call.c (sufficient_parms_p): Allow parameter packs too.
@@ -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;
}
new file mode 100644
@@ -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{};