* init.c (build_new_1): Use get_target_expr instead of save_expr.
* g++.dg/init/new24.C: New test.
From-SVN: r127668
+2007-08-21 Jakub Jelinek <jakub@redhat.com>
+
+ * init.c (build_new_1): Use get_target_expr instead of save_expr.
+
2007-08-20 Pawel Sikora <pluto@pld-linux.org>
PR c++/7302
placement_expr = NULL_TREE;
else
{
- placement_expr = save_expr (TREE_VALUE (placement));
+ placement_expr = get_target_expr (TREE_VALUE (placement));
placement = tree_cons (NULL_TREE, placement_expr, NULL_TREE);
}
2007-08-21 Jakub Jelinek <jakub@redhat.com>
+ * g++.dg/init/new24.C: New test.
+
PR middle-end/32912
* gcc.dg/pr32912-1.c: New test.
* gcc.dg/pr32912-2.c: New test.
--- /dev/null
+// PR c++/33025
+// { dg-do compile }
+// { dg-options "-O2" }
+
+typedef __SIZE_TYPE__ size_t;
+inline void *operator new (size_t, void *p) throw () { return p; }
+extern "C" void abort ();
+
+int
+main()
+{
+ const unsigned num = 10;
+ unsigned *data = new unsigned[num];
+ unsigned *ptr = new (data) unsigned (num);
+ static unsigned data2[10];
+ unsigned *ptr2 = new (&data2[0]) unsigned (10);
+ return 0;
+}