From: Jason Merrill Date: Mon, 20 Jun 2011 14:40:10 +0000 (-0400) Subject: re PR c++/49205 ([C++0x] Default constructor with pack expansion parameter not detected) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2602f8fe61dcf2388890bbbdb938e46ce9d2936b;p=gcc.git re PR c++/49205 ([C++0x] Default constructor with pack expansion parameter not detected) PR c++/49205 * call.c (sufficient_parms_p): Allow parameter packs too. From-SVN: r175214 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1746670c520..87e5164d9b6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-06-20 Jason Merrill + PR c++/49205 + * call.c (sufficient_parms_p): Allow parameter packs too. + PR c++/43321 * semantics.c (describable_type): Remove. * cp-tree.h: Likewise. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 05bf983f558..09d73d0c4c5 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6bfc81b0838..abc624597da 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2011-06-20 Jason Merrill + 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 index 00000000000..2625e259f78 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-default.C @@ -0,0 +1,12 @@ +// PR c++/49205 +// { dg-options -std=c++0x } + +#include + +struct A { + template A(T...); + A(std::initializer_list); + A(std::initializer_list); +}; + +A a{};