PR c++/47783
* cvt.c (convert_from_reference): Call mark_exp_read.
* g++.dg/warn/Wunused-parm-4.C: New test.
From-SVN: r170255
+2011-02-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47783
+ * cvt.c (convert_from_reference): Call mark_exp_read.
+
2011-02-11 Dodji Seketeli <dodji@redhat.com>
PR c++/47172
tree t = TREE_TYPE (TREE_TYPE (val));
tree ref = build1 (INDIRECT_REF, t, val);
+ mark_exp_read (val);
/* We *must* set TREE_READONLY when dereferencing a pointer to const,
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op. */
+2011-02-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47783
+ * g++.dg/warn/Wunused-parm-4.C: New test.
+
2011-02-17 Alexandre Oliva <aoliva@redhat.com>
Jan Hubicka <jh@suse.cz>
--- /dev/null
+// PR c++/47783
+// { dg-do compile }
+// { dg-options "-Wunused -W" }
+
+struct R
+{
+ int &i;
+};
+
+void
+foo (R r, int &s)
+{
+ r.i = 7;
+ s = 8;
+}
+
+int
+bar ()
+{
+ int x = 1, y = 1;
+ R r = { x };
+ foo (r, y);
+ return x + y;
+}