From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30493 invoked by alias); 18 Feb 2003 19:36:01 -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 30474 invoked by uid 71); 18 Feb 2003 19:36:00 -0000 Resent-Date: 18 Feb 2003 19:36:00 -0000 Resent-Message-ID: <20030218193600.30473.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, axiong@ca.ibm.com Received: (qmail 29632 invoked by uid 48); 18 Feb 2003 19:35:18 -0000 Message-Id: <20030218193518.29631.qmail@sources.redhat.com> Date: Tue, 18 Feb 2003 19:36:00 -0000 From: axiong@ca.ibm.com Reply-To: axiong@ca.ibm.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/9747: allocator::deallocate(*, int ) does not call ::operator delete(size_t). X-SW-Source: 2003-02/txt/msg00847.txt.bz2 List-Id: >Number: 9747 >Category: libstdc++ >Synopsis: allocator::deallocate(*, int ) does not call ::operator delete(size_t). >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Feb 18 19:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Guan-Zhu (Andrew) Xiong >Release: gcc version 3.2 >Organization: >Environment: Linux Version 2.4.19 SuSE SLES 8 (ppc) - Kernel 2.4.19-ul1-ppc64-SMP (16). >Description: => allocator::deallocate(*, int) does not call ::operator delete(size_t). => REF: ISO/IEC 14882:1998, 20.4.1.1 allocator members => WHAT: allocator::deallocate(*, int) shall call ::operator delete(size_t). 20.4.1.1;10a (2) => The following C++ code shows that the ::operator delete(size_t) is not called. -> Expected Return Code from "main": 0 -> Actual Run Return Code from "main": 1 >How-To-Repeat: 1) Compile the given code "hello.C" -> g++ -o hello hello.C 2) Run it -> hello 3) get the return code from "main()" - echo Return Code: $? Then you will get: Return Code: 1. However, the expected output sould be: Return Code: 0 >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="hello.C" Content-Disposition: inline; filename="hello.C" #include #include struct S {}; bool global = false; template class std::allocator; // explicit instantiation void operator delete(void *p) throw() { global = true; free(p); } int main(void) { std::allocator a; S* p = a.allocate(1); a.deallocate(p,1); if (!global) return 1; return 0; }