* tree.c (stabilize_init): Side effects make the init unstable.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@188021
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-05-30 Jason Merrill <jason@redhat.com>
+ PR c++/53356
+ * tree.c (stabilize_init): Side effects make the init unstable.
+
+2012-05-30 Jason Merrill <jason@redhat.com>
+
PR c++/53220
* call.c (convert_like_real) [ck_list]: Take array address directly.
* typeck.c (decay_conversion): Reject decay of an array compound
/* The initialization is being performed via a bitwise copy -- and
the item copied may have side effects. */
- return TREE_SIDE_EFFECTS (init);
+ return !TREE_SIDE_EFFECTS (init);
}
/* Like "fold", but should be used whenever we might be processing the
+2012-05-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/53356
+ * g++.dg/init/new33.C: New test.
+
2012-05-30 Jason Merrill <jason@redhat.com>
PR c++/53220
--- /dev/null
+// PR c++/53356
+// { dg-do compile }
+
+struct A {};
+struct B { operator const A & () const; };
+struct C { operator const A & () const; C (); };
+struct D { operator const A & () const; D (); ~D (); };
+
+A *foo () { return new A (B ()); }
+A *bar () { return new A (C ()); }
+A *baz () { return new A (D ()); }