Commit 358bb337 by Jason Merrill Committed by Jason Merrill

re PR c++/49482 ([C++0x] unused parameter warning on lambda in function template)

	PR c++/49482
	* semantics.c (maybe_add_lambda_conv_op): Call mark_exp_read for
	static fn parameters.

From-SVN: r175273
parent ccaff498
2011-06-21 Jason Merrill <jason@redhat.com>
PR c++/49482
* semantics.c (maybe_add_lambda_conv_op): Call mark_exp_read for
static fn parameters.
* call.c (add_builtin_candidates): Use cv_unqualified rather than
TYPE_MAIN_VARIANT.
* pt.c (tsubst_arg_types): Likewise.
......
......@@ -8780,7 +8780,10 @@ maybe_add_lambda_conv_op (tree type)
argvec = make_tree_vector ();
VEC_quick_push (tree, argvec, arg);
for (arg = DECL_ARGUMENTS (statfn); arg; arg = DECL_CHAIN (arg))
VEC_safe_push (tree, gc, argvec, arg);
{
mark_exp_read (arg);
VEC_safe_push (tree, gc, argvec, arg);
}
call = build_call_a (callop, VEC_length (tree, argvec),
VEC_address (tree, argvec));
CALL_FROM_THUNK_P (call) = 1;
......
2011-06-21 Jason Merrill <jason@redhat.com>
PR c++/49482
* g++.dg/cpp0x/lambda/lambda-warn3.C: New.
PR c++/49418
* g++.dg/template/param3.C: New.
......
// PR c++/49482
// { dg-options "-std=c++0x -Wunused-but-set-parameter" }
template<class T>
void f() {
[]( bool b ){ return b; };
}
int main()
{
f<int>();
}
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