From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18393 invoked by alias); 11 Apr 2003 14: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 18365 invoked by uid 71); 11 Apr 2003 14:56:00 -0000 Resent-Date: 11 Apr 2003 14:56:00 -0000 Resent-Message-ID: <20030411145600.18364.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, nick.brook@3glab.com Received: (qmail 11908 invoked by uid 48); 11 Apr 2003 14:53:18 -0000 Message-Id: <20030411145318.11907.qmail@sources.redhat.com> Date: Fri, 11 Apr 2003 14:56:00 -0000 From: nick.brook@3glab.com Reply-To: nick.brook@3glab.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/10378: cannot add object with inplace new into STL collections X-SW-Source: 2003-04/txt/msg00504.txt.bz2 List-Id: >Number: 10378 >Category: libstdc++ >Synopsis: cannot add object with inplace new into STL collections >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Apr 11 14:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: nick.brook@3glab.com >Release: 3.0.4 >Organization: >Environment: Linux (Debian testing) >Description: The following chunk of code doesn't compile - there seems to be a problem with adding objects that define a simple inplace new operator to STL collection classes. Note that the code WILL compile if the second new operator if defined instead of the first one. I first came across this when recompiling some code that uses IBM's ICU Unicode library, as their UnicodeString class now defines an inplace new & delete operator in the base class. This means i can't add UnicodeString objects to an STL list without amending the original ICU library. >How-To-Repeat: Just compile. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/x-c++src; name="tst.cc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tst.cc" I2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCmNsYXNzIEJvYgp7CnB1YmxpYzoK ICAgIC8vIFdvbid0IGNvbXBpbGUgd2l0aCB0aGlzIG5ldyBvcGVyYXRvciAKICAgIHN0YXRpYyB2 b2lkICogb3BlcmF0b3IgbmV3KHNpemVfdCBzeikKICAgIHsKICAgICAgICByZXR1cm4gbWFsbG9j KHN6KTsKICAgIH0KCgogICAgLy8gV2lsbCBjb21waWxlIHdpdGggdGhpcyBvcGVyYXRvcgovLyAg ICAgc3RhdGljIHZvaWQgKiBvcGVyYXRvciBuZXcoc2l6ZV90IHN6LCB2b2lkICopCi8vICAgICB7 Ci8vICAgICAgICAgcmV0dXJuIG1hbGxvYyhzeik7Ci8vICAgICB9Cn07CgppbnQgbWFpbihpbnQg YXJnYywgY2hhciAqKmFyZ3YpCnsKICAgIHN0ZDo6bGlzdDxCb2I+IHVuaXNldDsKICAgIHVuaXNl dC5wdXNoX2JhY2soQm9iKCkpOwogICAgcmV0dXJuIDA7Cn0KCiAgICAK