commit dec88b99a5f96603df3518da6b108e058613bc2d
Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue Jun 21 20:07:45 2011 +0000
PR c++/49482
* semantics.c (maybe_add_lambda_conv_op): Call mark_exp_read for
static fn parameters.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175273 138bc75d-0d04-0410-961f-82ee72b054a4
@@ -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;
new file mode 100644
@@ -0,0 +1,12 @@
+// 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>();
+}