Commit 80390766 by Jason Merrill Committed by Jason Merrill

re PR c++/49251 ([C++0x][parameter pack expanding] unused parameter warning with…

re PR c++/49251 ([C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples)

	PR c++/49251
	* semantics.c (finish_id_expression): Mark even dependent
	variables as used.

From-SVN: r175119
parent 89a27d8f
2011-06-16 Jason Merrill <jason@redhat.com>
PR c++/49251
* semantics.c (finish_id_expression): Mark even dependent
variables as used.
PR c++/49420
* error.c (dump_template_argument): Don't try to omit default
template args from an argument pack.
......
......@@ -3196,7 +3196,10 @@ finish_id_expression (tree id_expression,
(or an instantiation thereof). */
if (TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == PARM_DECL)
return convert_from_reference (decl);
{
mark_used (decl);
return convert_from_reference (decl);
}
/* The same is true for FIELD_DECL, but we also need to
make sure that the syntax is correct. */
else if (TREE_CODE (decl) == FIELD_DECL)
......
2011-06-16 Jason Merrill <jason@redhat.com>
PR c++/49251
* g++.dg/cpp0x/variadic113.C: New.
PR c++/49420
* g++.dg/cpp0x/variadic112.C: New.
......
// PR c++/49251
// { dg-options "-std=c++0x -Wunused-parameter" }
struct A {};
template <int> int f(A);
template< int... Indices >
struct indices {};
template< class... Args >
void sink( Args&&... ) {}
template< class T, int... Indices >
void unpack_test( T && t, indices<Indices...> ) {
sink( f<Indices>(t)... );
}
int main() {
unpack_test( A(), indices<>() );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment