From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16656 invoked by alias); 27 Feb 2003 04:56:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 16613 invoked by uid 71); 27 Feb 2003 04:56:00 -0000 Resent-Date: 27 Feb 2003 04:56:00 -0000 Resent-Message-ID: <20030227045600.16611.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, sakovacs@freemail.hu Received: (qmail 12364 invoked by uid 48); 27 Feb 2003 04:47:06 -0000 Message-Id: <20030227044706.12363.qmail@sources.redhat.com> Date: Thu, 27 Feb 2003 04:56:00 -0000 From: sakovacs@freemail.hu Reply-To: sakovacs@freemail.hu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9872: temporary destructor not called? X-SW-Source: 2003-02/txt/msg01406.txt.bz2 List-Id: >Number: 9872 >Category: c++ >Synopsis: temporary destructor not called? >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Thu Feb 27 04:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Sandor Kovacs >Release: gcc 3.2 >Organization: >Environment: intel linux suse 8.1, kernel 2.4.20-ck2, qt 3.1 >Description: Temporary object is not properly destructed (see test prg. below which eats the memory up): #include void tester(QString str) { } int main(int argc, char** argv) { QString str("bug"); while (true) tester("ops: " + str); } Compiled as: gcc -I/usr/lib/qt3/include -c bug.cpp gcc -L/usr/lib/qt3/lib -lqt-mt bug.o -o bug If you specify -fno-elide-constructors it works properly (that's why I believe it is not a qt-bug) There was already a fix for this/similar bug hopefully I'm not reporting it twice (couldn't find this bug on the bug list), see http://sources.redhat.com/ml/cygwin/2001-10/msg00467.html. If you think it is a QT bug please let me know and in this case I'll drop Trolltech a line. Thanks: Sandor >How-To-Repeat: compile, run the sample program >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/x-c++src; name="bug.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bug.cpp" LyoqCiAqIENvbXBpbGU6CiAqIGdjYyAtSS91c3IvbGliL3F0My9pbmNsdWRlIC1jIGJ1Zy5jcHAK ICogZ2NjIC1ML3Vzci9saWIvcXQzL2xpYiAtbHF0LW10IGJ1Zy5vIC1vIGJ1ZwogKi8KCiNpbmNs dWRlIDxxc3RyaW5nLmg+Cgp2b2lkIHRlc3RlcihRU3RyaW5nIHN0cikgewp9CgppbnQgbWFpbihp bnQgYXJnYywgY2hhcioqIGFyZ3YpIHsKICAgIFFTdHJpbmcgc3RyKCJidWciKTsKICAgIHdoaWxl ICh0cnVlKSB0ZXN0ZXIoIm9wczogIiArIHN0cik7Cn0K