From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22288 invoked by alias); 8 Apr 2004 02:22:31 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22265 invoked from network); 8 Apr 2004 02:22:26 -0000 Received: from unknown (HELO mta6.wss.scd.yahoo.com) (66.218.85.37) by sources.redhat.com with SMTP; 8 Apr 2004 02:22:26 -0000 Received: from specifixinc.com (24.7.123.142) by mta6.wss.scd.yahoo.com (7.0.016) (authenticated as jim@tuliptree.org) id 4072403F00119502; Wed, 7 Apr 2004 19:22:25 -0700 Message-ID: <4074B769.4070705@specifixinc.com> Date: Thu, 08 Apr 2004 02:22:00 -0000 From: Jim Wilson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030716 MIME-Version: 1.0 To: Nilmoni Deb CC: gcc-bugs@gcc.gnu.org Subject: Re: g++ delete issue References: <40722AA9.8010608@ece.cmu.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-04/txt/msg00698.txt.bz2 List-Id: Nilmoni Deb wrote: > My concern is that the compiler allows the explicit "delete &u" > operation even though the variable u is not user allocated. Should > the compiler be expected to give a warning/error message when such a > statement appears ? In general, you will get better answers if you file bugs into our bugzilla bug database rather than sending email to gcc-bugs. We don't track bugs sent via email. I don't have a copy of the C++ standard, so I can't comment definitively on this. However, I can note that in general it is not possible for the compiler to know how an object has been allocated in all cases. The object might have been allocated in a different function for instance. There might be multiple assignments to the variable under different conditions, and it may not be obvious at compile time which one will reach the delete. In such cases, language standards generally do not require any warning/error at all, even for relatively simple cases like this one. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com