re PR c++/11266 ([tree-ssa] ICE with placement new)
authorJason Merrill <jason@gcc.gnu.org>
Mon, 17 Nov 2003 16:33:59 +0000 (11:33 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 17 Nov 2003 16:33:59 +0000 (11:33 -0500)
        PR c++/11266
        * gimplify.c (gimple_add_tmp_var): Also make sure
        seen_in_bind_expr isn't set.
        (mostly_copy_tree_r): Don't copy a TARGET_EXPR.
        (gimplify_target_expr): Only expand a TARGET_EXPR the first time
        we see it.

[[Split portion of a mixed commit.]]

From-SVN: r73674.2

gcc/testsuite/g++.dg/init/placement1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/init/placement1.C b/gcc/testsuite/g++.dg/init/placement1.C
new file mode 100644 (file)
index 0000000..50030af
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/11266
+// We were expanding the same TARGET_EXPR twice, for placement new and
+// delete.
+
+void* operator new    (unsigned int, void*) throw();
+void  operator delete (void*, void*)        throw();
+
+struct A { A(); };
+
+void foo() { new(new A)A; }