Commit 207fd212 by Jason Merrill Committed by Jason Merrill

re PR c++/61465 (Bogus parameter set but not used warning in constructor initialization list)

	PR c++/61465
	* call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
	after pulling out an element from a CONSTRUCTOR.

From-SVN: r215413
parent dfd20b82
2014-09-19 Jason Merrill <jason@redhat.com>
PR c++/61465
* call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
after pulling out an element from a CONSTRUCTOR.
2014-09-18 Jakub Jelinek <jakub@redhat.com> 2014-09-18 Jakub Jelinek <jakub@redhat.com>
PR c++/63248 PR c++/63248
......
...@@ -6206,7 +6206,6 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -6206,7 +6206,6 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
return expr; return expr;
} }
case ck_identity: case ck_identity:
expr = mark_rvalue_use (expr);
if (BRACE_ENCLOSED_INITIALIZER_P (expr)) if (BRACE_ENCLOSED_INITIALIZER_P (expr))
{ {
int nelts = CONSTRUCTOR_NELTS (expr); int nelts = CONSTRUCTOR_NELTS (expr);
...@@ -6217,6 +6216,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -6217,6 +6216,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
else else
gcc_unreachable (); gcc_unreachable ();
} }
expr = mark_rvalue_use (expr);
if (type_unknown_p (expr)) if (type_unknown_p (expr))
expr = instantiate_type (totype, expr, complain); expr = instantiate_type (totype, expr, complain);
......
// PR c++/61465
// { dg-do compile { target c++11 } }
// { dg-options "-Wunused-but-set-parameter" }
struct Foo {
Foo(void* x) : y{static_cast<char*>(x)} {}
char* y;
};
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