public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "steve_cheng at scotiacapital dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/34158] Template delete doesn't call if exception thrown in constructor
Date: Fri, 23 May 2008 13:42:00 -0000	[thread overview]
Message-ID: <20080523134156.2592.qmail@sourceware.org> (raw)
In-Reply-To: <bug-34158-15391@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from steve_cheng at scotiacapital dot com  2008-05-23 13:41 -------
I have hit the same bug as the original reporter.  
Attached is a simplified test case.  Run with:

$ g++ -v -save-temps -o testPlacementDelete testPlacementDelete.C 
$ ./testPlacementDelete
placement new called
exception caught

Expected output should be instead:
placement new called
placement delete called
exception caught

Note that the placement delete is called if the extra argument to placement new
and delete is a non-templated type.  It fails when the extra argument is a
templated type.

I am running on:

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
 /usr/lib/gcc/i486-linux-gnu/4.1.3/cc1plus -E -quiet -v -D_GNU_SOURCE
testPlacementDelete.C -mtune=generic -fpch-preprocess -o testPlacementDelete.ii
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../i486-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.1.3
 /usr/include/c++/4.1.3/i486-linux-gnu
 /usr/include/c++/4.1.3/backward
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.1.3/include
 /usr/include
End of search list.
 /usr/lib/gcc/i486-linux-gnu/4.1.3/cc1plus -fpreprocessed
testPlacementDelete.ii -quiet -dumpbase testPlacementDelete.C -mtune=generic
-auxbase testPlacementDelete -version -fstack-protector -fstack-protector -o
testPlacementDelete.s
GNU C++ version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
(i486-linux-gnu)
        compiled by GNU C version 4.1.3 20070929 (prerelease) (Ubuntu
4.1.2-16ubuntu2).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129322
Compiler executable checksum: 3cc47be363985179cfafdceddd0e8f5d
 as --traditional-format -V -Qy -o testPlacementDelete.o testPlacementDelete.s
GNU assembler version 2.18 (i486-linux-gnu) using BFD version (GNU Binutils for
Ubuntu) 2.18
 /usr/lib/gcc/i486-linux-gnu/4.1.3/collect2 --eh-frame-hdr -m elf_i386
--hash-style=both -dynamic-linker /lib/ld-linux.so.2 -o testPlacementDelete
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crti.o
/usr/lib/gcc/i486-linux-gnu/4.1.3/crtbegin.o
-L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3
-L/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib -L/lib/../lib
-L/usr/lib/../lib testPlacementDelete.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s
-lgcc /usr/lib/gcc/i486-linux-gnu/4.1.3/crtend.o
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crtn.o


-- 

steve_cheng at scotiacapital dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steve_cheng at scotiacapital
                   |                            |dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34158


  parent reply	other threads:[~2008-05-23 13:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20  3:50 [Bug c++/34158] New: " andry at inbox dot ru
2008-01-28  8:24 ` [Bug c++/34158] " andry at inbox dot ru
2008-05-15 14:11 ` andry at inbox dot ru
2008-05-23 13:42 ` steve_cheng at scotiacapital dot com [this message]
2008-05-23 13:44 ` steve_cheng at scotiacapital dot com
2008-05-23 13:45 ` steve_cheng at scotiacapital dot com
2008-11-01 16:19 ` jwakely dot gcc at gmail dot com
2009-11-10  3:47 ` jason at gcc dot gnu dot org
2009-11-10 18:19 ` jason at gcc dot gnu dot org
2009-11-20  2:32 ` jason at gcc dot gnu dot org
2009-11-20  2:37 ` jason at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080523134156.2592.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).