From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6230 invoked by alias); 14 Mar 2002 06:06:02 -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 6181 invoked by uid 71); 14 Mar 2002 06:06:01 -0000 Resent-Date: 14 Mar 2002 06:06:01 -0000 Resent-Message-ID: <20020314060601.6175.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, vatsan@vsnl.com Resent-Reply-To: gcc-gnats@gcc.gnu.org, smadhavan@inautix.com Received:(qmail 32554 invoked by uid 61); 14 Mar 2002 06:02:15 -0000 Message-Id:<20020314060215.32552.qmail@sources.redhat.com> Date: Wed, 13 Mar 2002 22:06:00 -0000 From: smadhavan@inautix.com Reply-To: smadhavan@inautix.com To: gcc-gnats@gcc.gnu.org Cc: vatsan@vsnl.com X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify:vatsan@vsnl.com Subject: c++/5958: Multiple calls to destructor of local objects, inside a for-loop X-SW-Source: 2002-03/txt/msg00469.txt.bz2 List-Id: >Number: 5958 >Category: c++ >Synopsis: Multiple calls to destructor of local objects, inside a for-loop >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Mar 13 22:06:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Srivathsan Madhavan >Release: GCC ver. 3.0.3 >Organization: >Environment: Cygwin 1.3.9-1, Windows NT 4 SP6a, Intel PIII >Description: An extra call(s) to the destructor is made during object destruction of local objects (inside the loop). This could be understood by compiling and executing the C++ Program attached. The behaviour of the executable (created by g++) was compared with that created by Borlad C++ ver. 5.5.1 (bcc32) for Win32. I feel what the Borland Compiler is doing is right. >How-To-Repeat: Just compile the attached source code file with G++ and Borland's bcc32 (ver. 5.5.1). Execute the 2 EXEs and you will see the difference. For convenience I have given the outputs of the 2 EXEs in a comment block at the end of the source code. >Fix: -?- >Release-Note: >Audit-Trail: >Unformatted: