re PR c++/49593 ([C++0x] cannot use T{t}... as pack expansion)

PR c++/49593
	* pt.c (find_parameter_packs_r): Handle CONSTRUCTOR.

From-SVN: r177214
This commit is contained in:
Jason Merrill 2011-08-02 17:09:08 -04:00 committed by Jason Merrill
parent adc651f305
commit 326a64554b
4 changed files with 26 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2011-08-02 Jason Merrill <jason@redhat.com>
PR c++/49593
* pt.c (find_parameter_packs_r): Handle CONSTRUCTOR.
PR c++/49803
* init.c (sort_mem_initializers): Initialize uses_unions_p here.
(build_field_list): Not here.

View File

@ -3025,6 +3025,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
*walk_subtrees = 0;
return NULL_TREE;
case CONSTRUCTOR:
case TEMPLATE_DECL:
cp_walk_tree (&TREE_TYPE (t),
&find_parameter_packs_r, ppd, ppd->visited);

View File

@ -1,5 +1,8 @@
2011-08-02 Jason Merrill <jason@redhat.com>
PR c++/49593
* g++.dg/cpp0x/variadic115.C: New.
PR c++/49803
* g++.dg/cpp0x/union5.C: New.

View File

@ -0,0 +1,19 @@
// PR c++/49593
// { dg-options -std=c++0x }
template<typename... T> void f(T...) { }
template<typename... Args>
static void
g(Args&&... args)
{
f( static_cast<Args>(args)... );
f( (Args)args... );
f( Args(args)... );
f( Args{args}... );
}
int main()
{
g(1, '2', 3.0);
}