PR c++/48873
* tree.c (stabilize_expr): Don't make gratuitous copies of classes.
From-SVN: r173979
+2011-05-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/48873
+ * tree.c (stabilize_expr): Don't make gratuitous copies of classes.
+
2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39219
if (!TREE_SIDE_EFFECTS (exp))
init_expr = NULL_TREE;
else if (!real_lvalue_p (exp)
- || !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (exp)))
+ || (!TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (exp))
+ && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (exp))))
{
init_expr = get_target_expr (exp);
exp = TARGET_EXPR_SLOT (init_expr);
+2011-05-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/init/new32.C: New.
+
2011-05-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Backport from mainline:
--- /dev/null
+// PR c++/48873
+
+#include <new>
+
+struct D {
+private:
+ ~D();
+};
+
+template<class T>
+T& create();
+
+void f()
+{
+ D* dp = new (((void*) 0)) D(create<D>()); // #
+}