2013-09-09 Jakub Jelinek <jakub@redhat.com>
PR c++/58325
* init.c (build_vec_delete): Call mark_rvalue_use on base.
* g++.dg/warn/Wunused-var-21.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@210172
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-05-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2013-09-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/58325
+ * init.c (build_vec_delete): Call mark_rvalue_use on base.
+
2014-02-26 Fabien ChĂȘne <fabien@gcc.gnu.org>
+
PR c++/37140
* parser.c (cp_parser_nonclass_name): Call strip_using_decl and
move the code handling dependent USING_DECLs...
tree cookie_addr;
tree size_ptr_type = build_pointer_type (sizetype);
+ base = mark_rvalue_use (base);
if (TREE_SIDE_EFFECTS (base))
{
base_init = get_target_expr (base);
2014-05-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2013-09-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/58325
+ * g++.dg/warn/Wunused-var-21.C: New test.
+
2013-08-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58277
--- /dev/null
+// PR c++/58325
+// { dg-do compile }
+// { dg-options "-Wunused" }
+
+void
+f1 ()
+{
+ int *volatile a = new int[1];
+ delete[] a;
+}
+
+void
+f2 ()
+{
+ int *b = new int[1];
+ delete[] b;
+}
+
+void
+f3 ()
+{
+ int *volatile c = new int;
+ delete c;
+}
+
+void
+f4 ()
+{
+ int *d = new int;
+ delete d;
+}