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:
parent
adc651f305
commit
326a64554b
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
||||
|
19
gcc/testsuite/g++.dg/cpp0x/variadic115.C
Normal file
19
gcc/testsuite/g++.dg/cpp0x/variadic115.C
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user