* init.c (build_new_1): Look up operator delete even if there was
authoroliva <oliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 13 Jun 1999 01:17:12 +0000 (01:17 +0000)
committeroliva <oliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 13 Jun 1999 01:17:12 +0000 (01:17 +0000)
no explicit new placement.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27502 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/init.c

index 136fd27..03f4af8 100644 (file)
@@ -1,3 +1,8 @@
+1999-06-13  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * init.c (build_new_1): Look up operator delete even if there was
+       no explicit new placement.
+
 1999-06-08  Nathan Sidwell  <nathan@acm.org>
 
        * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
index 1bbc51e..fc500e6 100644 (file)
@@ -2418,15 +2418,15 @@ build_new_1 (exp)
          /* All cleanups must last longer than normal.  */
          int yes = suspend_momentary ();
 
-         if (placement)
-           {
-             flags |= LOOKUP_SPECULATIVELY;
-
-             /* We expect alloc_expr to look like a TARGET_EXPR around
-                a NOP_EXPR around the CALL_EXPR we want.  */
-             fn = TREE_OPERAND (alloc_expr, 1);
-             fn = TREE_OPERAND (fn, 0);
-           }
+         /* The Standard is unclear here, but the right thing to do
+             is to use the same method for finding deallocation
+             functions that we use for finding allocation functions.  */
+         flags |= LOOKUP_SPECULATIVELY;
+
+         /* We expect alloc_expr to look like a TARGET_EXPR around
+            a NOP_EXPR around the CALL_EXPR we want.  */
+         fn = TREE_OPERAND (alloc_expr, 1);
+         fn = TREE_OPERAND (fn, 0);
 
          /* Copy size to the saveable obstack.  */
          size = mapcar (size, permanent_p);