diff options
author | Alexandre Oliva <oliva@dcc.unicamp.br> | 1999-06-13 01:17:12 +0000 |
---|---|---|
committer | Alexandre Oliva <oliva@gcc.gnu.org> | 1999-06-13 01:17:12 +0000 |
commit | 5355deec1ffa2cb269b72429563a91807b37f14a (patch) | |
tree | a9b8ce81599077e53b3b1af876c75dd61835d79c /gcc | |
parent | 3a6bf921531b5c99e189415f35896d2a95244fa5 (diff) | |
download | gcc-5355deec1ffa2cb269b72429563a91807b37f14a.zip gcc-5355deec1ffa2cb269b72429563a91807b37f14a.tar.gz gcc-5355deec1ffa2cb269b72429563a91807b37f14a.tar.bz2 |
init.c (build_new_1): Look up operator delete even if there was no explicit new placement.
* init.c (build_new_1): Look up operator delete even if there was
no explicit new placement.
From-SVN: r27502
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 136fd27..03f4af8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 1bbc51e..fc500e6 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -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); |