From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2807 invoked by alias); 23 May 2008 13:42:49 -0000 Received: (qmail 2593 invoked by uid 48); 23 May 2008 13:41:56 -0000 Date: Fri, 23 May 2008 13:42:00 -0000 Message-ID: <20080523134156.2592.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/34158] Template delete doesn't call if exception thrown in constructor In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "steve_cheng at scotiacapital dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg01781.txt.bz2 ------- 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