+2017-03-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79746
+ * init.c (emit_mem_initializers): When not constructing vbases of
+ abstract classes, mark arguments as read for
+ -Wunused-but-set-parameter.
+
2017-02-28 Jason Merrill <jason@redhat.com>
Class template argument deduction refinements
/* C++14 DR1658 Means we do not have to construct vbases of
abstract classes. */
construct_virtual_base (subobject, arguments);
+ else
+ /* When not constructing vbases of abstract classes, at least mark
+ the arguments expressions as read to avoid
+ -Wunused-but-set-parameter false positives. */
+ for (tree arg = arguments; arg; arg = TREE_CHAIN (arg))
+ mark_exp_read (TREE_VALUE (arg));
if (inherited_base)
pop_deferring_access_checks ();
2017-03-01 Jakub Jelinek <jakub@redhat.com>
+ PR c++/79746
+ * g++.dg/warn/Wunused-parm-9.C: New test.
+
PR tree-optimization/79734
* g++.dg/opt/pr79734.C: New test.
--- /dev/null
+// PR c++/79746
+// { dg-do compile }
+// { dg-options "-Wunused-but-set-parameter" }
+
+struct A {
+ A (const char *x) : a(x) {} // { dg-bogus "set but not used" }
+ virtual int foo () = 0;
+ const char *a;
+};
+struct B : public virtual A {
+ B (const char *x) : A(x) {} // { dg-bogus "set but not used" }
+};